Re: [PATCH] diff: exit(1) if 'diff --quiet <repo file> <external file>' finds changes
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 15, 2012, 20:08 UTC
- Message-ID
- <7vmx449w3j.fsf@alter.siamese.dyndns.org>
- In-Reply-To
- <CAFoueth2Hfcv0p0SZmichi_6e5--SNkemrSsSivnU73bdFOB4g@mail.gmail.com>
Tim Henigan <tim.henigan@gmail.com> writes:
Show 9 quoted lines
>>> @@ -273,5 +273,6 @@ void diff_no_index(struct rev_info *revs, >>> * The return code for --no-index imitates diff(1): >>> * 0 = no changes, 1 = changes, else error >>> */ >>> - exit(revs->diffopt.found_changes); >>> + result = !!diff_result_code(&revs->diffopt, 0); >>> + exit(result); > > I assume the '!!' before 'diff_result_code' is a typo.
Not a typo. I meant to use that idiom to turn 0 or not into boolean, as diff_result_code() can return values other than 0 or 1.