Commit c01d938
George Dunlap
Remove "appendix" information from commit message
...when parsing emails, similar to `git am`.
Add a new field, `BodyAppendix` to PatchHeader.
Modify `scanMessageBody` to accept a boolean argument saying whether
to separate out the appendix or not. Do this by keeping two string
builders, and having it switch to the appendix builder when it finds a
`---` line.
Handling the newlines at the end as expected requires moving things
around a bit.
First, we were trimming space from the line once to decide whether the
line was empty, and then trimming space again if we determined it
wasn't empty. This only needs to be done once.
Then, do all the trimming (both of whitespace and the prefix) first,
before deciding what to do about the line.
Request BodyAppendix separately when parsing a mail, but not a commit
message.
Add some tests to verify that it works as expected.
Signed-off-by: George Dunlap <george.dunlap@citrix.com>1 parent 379b893 commit c01d938
2 files changed
+95
-16
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
47 | 52 | | |
48 | 53 | | |
49 | 54 | | |
| |||
165 | 170 | | |
166 | 171 | | |
167 | 172 | | |
168 | | - | |
| 173 | + | |
169 | 174 | | |
170 | 175 | | |
171 | 176 | | |
172 | 177 | | |
173 | | - | |
174 | | - | |
175 | | - | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
176 | 190 | | |
177 | 191 | | |
178 | 192 | | |
| |||
277 | 291 | | |
278 | 292 | | |
279 | 293 | | |
280 | | - | |
| 294 | + | |
| 295 | + | |
281 | 296 | | |
282 | 297 | | |
283 | 298 | | |
| |||
309 | 324 | | |
310 | 325 | | |
311 | 326 | | |
312 | | - | |
313 | | - | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
314 | 331 | | |
315 | 332 | | |
316 | 333 | | |
317 | | - | |
| 334 | + | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
318 | 339 | | |
319 | 340 | | |
320 | 341 | | |
321 | 342 | | |
322 | | - | |
323 | | - | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
324 | 352 | | |
325 | | - | |
| 353 | + | |
326 | 354 | | |
327 | 355 | | |
328 | 356 | | |
329 | 357 | | |
330 | | - | |
331 | | - | |
332 | | - | |
| 358 | + | |
333 | 359 | | |
334 | | - | |
| 360 | + | |
335 | 361 | | |
336 | 362 | | |
337 | 363 | | |
| |||
372 | 398 | | |
373 | 399 | | |
374 | 400 | | |
375 | | - | |
| 401 | + | |
376 | 402 | | |
377 | 403 | | |
378 | 404 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
139 | 139 | | |
140 | 140 | | |
141 | 141 | | |
| 142 | + | |
142 | 143 | | |
143 | 144 | | |
144 | 145 | | |
| |||
221 | 222 | | |
222 | 223 | | |
223 | 224 | | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
224 | 251 | | |
225 | 252 | | |
226 | 253 | | |
| |||
240 | 267 | | |
241 | 268 | | |
242 | 269 | | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
243 | 292 | | |
244 | 293 | | |
245 | 294 | | |
| |||
333 | 382 | | |
334 | 383 | | |
335 | 384 | | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
336 | 389 | | |
337 | 390 | | |
338 | 391 | | |
| |||
0 commit comments