Re: [PATCH 1/2] diff: Fix modified lines stats with --stat and --numstat
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Sep 23, 2020, 19:23 UTC
- Message-ID
- <xmqqk0wki9fh.fsf@gitster.c.googlers.com>
- In-Reply-To
- <nycvar.QRO.7.76.6.2009231709340.5061@tvgsbejvaqbjf.bet>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 5 quoted lines
> I believe that that is exactly the reason why we want this: > > - same_contents = oideq(&one->oid, &two->oid); > + same_contents = one->oid_valid && two->oid_valid ? > oideq(&one->oid, &two->oid) : !strcmp(one->data, two->data);
Not quite. The other side should either be
one->size == two->size && !memcmp(...)
or just left to false, as the downstream code must be prepared for same_contents being false even when one and two turns out to be not-byte-for-byte-same but equivalent anyway.