Re: git diff --exit-code misbehaving in 2.46.x
- From
René Scharfe <l.s.r@web.de>
- Date
- Sep 25, 2024, 15:26 UTC
- Message-ID
- <e3da5c9b-c208-4937-a2b4-e1028f3e6841@web.de>
- In-Reply-To
- <CAB0mhhz9LHZ1AWSu_0oM=c89+z0w=XemnQwFAm45wp8zSmQ1Sw@mail.gmail.com>
Am 25.09.24 um 16:27 schrieb Jan Wendland:
Show 19 quoted lines
> Hey team, > > git diff --exit-code in 2.46.x is unexpectedly returning a zero exit > code for files marked as binary in .gitattributes where 2.45.x would > correctly produce a non-zero exit code. > > To reproduce: > mkdir -p git-exit-code/dist > cd git-exit-code > git init > echo "hi" > dist/main.js > echo "dist/** binary" > .gitattributes > git add --all > git commit -m "Initial commit" > echo "some change" >> dist/main.js > git diff --exit-code > echo $? # actual is 0, expected to be 1 > > Is this intended?
Thanks for the report! This is a known bug. The "next" branch contains a fix, 9a41735af6 (diff: report modified binary files as changes in builtin_diff(), 2024-09-21).
René