Skip to content

Commit

Permalink
diff: ignore mode in binary size optimization
Browse files Browse the repository at this point in the history
This makes add/delete work.

Signed-off-by: Jeff King <[email protected]>
  • Loading branch information
peff committed Nov 27, 2024
1 parent cc01bad commit 1a05ec6
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -3657,9 +3657,7 @@ static void builtin_diff(const char *name_a,
( (!textconv_one && diff_filespec_is_binary(o->repo, one)) ||
(!textconv_two && diff_filespec_is_binary(o->repo, two)) )) {
struct strbuf sb = STRBUF_INIT;
if (!one->data && !two->data &&
S_ISREG(one->mode) && S_ISREG(two->mode) &&
!o->flags.binary) {
if (!one->data && !two->data && !o->flags.binary) {
if (oideq(&one->oid, &two->oid)) {
if (must_show_header)
emit_diff_symbol(o, DIFF_SYMBOL_HEADER,
Expand Down

0 comments on commit 1a05ec6

Please sign in to comment.