Commit 9b08091
diff: have submodule_format logic avoid additional diff headers
Commit 95433ee ("diff: add ability to insert additional headers for
paths", 2022-02-02) introduced the possibility of additional headers,
created in create_filepairs_for_header_only_notifications(). These are
represented by inserting additional pairs in diff_queued_diff which
always have a mode of 0 and a null_oid. When these were added, one
code path was noted to assume that at least one of the diff_filespecs
in the pair were valid, and that codepath was corrected.
The submodule_format handling is another codepath with the same issue;
it would operate on these additional headers and attempt to display them
as submodule changes. Prevent that by explicitly checking for "phoney"
filepairs (i.e. filepairs with both modes being 0).
Reported-by: Philippe Blain <[email protected]>
Signed-off-by: Elijah Newren <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>1 parent d42b38d commit 9b08091
2 files changed
+31
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3398 | 3398 | | |
3399 | 3399 | | |
3400 | 3400 | | |
| 3401 | + | |
| 3402 | + | |
| 3403 | + | |
| 3404 | + | |
| 3405 | + | |
| 3406 | + | |
| 3407 | + | |
| 3408 | + | |
| 3409 | + | |
| 3410 | + | |
| 3411 | + | |
| 3412 | + | |
| 3413 | + | |
| 3414 | + | |
| 3415 | + | |
3401 | 3416 | | |
3402 | 3417 | | |
3403 | 3418 | | |
| |||
3429 | 3444 | | |
3430 | 3445 | | |
3431 | 3446 | | |
3432 | | - | |
| 3447 | + | |
| 3448 | + | |
3433 | 3449 | | |
3434 | 3450 | | |
3435 | 3451 | | |
3436 | 3452 | | |
3437 | 3453 | | |
3438 | 3454 | | |
3439 | | - | |
| 3455 | + | |
| 3456 | + | |
3440 | 3457 | | |
3441 | 3458 | | |
3442 | 3459 | | |
| |||
3456 | 3473 | | |
3457 | 3474 | | |
3458 | 3475 | | |
3459 | | - | |
| 3476 | + | |
3460 | 3477 | | |
3461 | | - | |
| 3478 | + | |
3462 | 3479 | | |
3463 | | - | |
3464 | | - | |
| 3480 | + | |
| 3481 | + | |
3465 | 3482 | | |
3466 | 3483 | | |
3467 | 3484 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
185 | 185 | | |
186 | 186 | | |
187 | 187 | | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
188 | 196 | | |
189 | 197 | | |
190 | 198 | | |
| |||
0 commit comments