diff options
author | Junio C Hamano <gitster@pobox.com> | 2024-09-13 15:27:43 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-09-13 15:27:43 -0700 |
commit | 41390eb3e6411925365a4932ca4b5c12e609c779 (patch) | |
tree | 8f133156fd224de1034a913b7e265e2a6733ebde /diff.c | |
parent | da1c402a47e574c13fe2f0f205a2f0eec2224bb7 (diff) | |
parent | 11591850ddd5e65d3d0aab22c0a7131b1eb1d6f0 (diff) |
Merge branch 'rs/diff-exit-code-fix'
In a few corner cases "git diff --exit-code" failed to report
"changes" (e.g., renamed without any content change), which has
been corrected.
* rs/diff-exit-code-fix:
diff: report dirty submodules as changes in builtin_diff()
diff: report copies and renames as changes in run_diff_cmd()
Diffstat (limited to 'diff.c')
-rw-r--r-- | diff.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -3565,6 +3565,7 @@ static void builtin_diff(const char *name_a, show_submodule_diff_summary(o, one->path ? one->path : two->path, &one->oid, &two->oid, two->dirty_submodule); + o->found_changes = 1; return; } else if (o->submodule_format == DIFF_SUBMODULE_INLINE_DIFF && (!one->mode || S_ISGITLINK(one->mode)) && @@ -3573,6 +3574,7 @@ static void builtin_diff(const char *name_a, show_submodule_inline_diff(o, one->path ? one->path : two->path, &one->oid, &two->oid, two->dirty_submodule); + o->found_changes = 1; return; } @@ -4587,6 +4589,9 @@ static void run_diff_cmd(const struct external_diff *pgm, builtin_diff(name, other ? other : name, one, two, xfrm_msg, must_show_header, o, complete_rewrite); + if (p->status == DIFF_STATUS_COPIED || + p->status == DIFF_STATUS_RENAMED) + o->found_changes = 1; } else { fprintf(o->file, "* Unmerged path %s\n", name); o->found_changes = 1; |