Re: Bug in fetch-pack.c, please confirm
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 15, 2015, 07:30 UTC
- Message-ID
- <xmqq3856vhtt.fsf@gitster.dls.corp.google.com>
- In-Reply-To
- <xmqqa8zevhya.fsf@gitster.dls.corp.google.com>
Junio C Hamano <gitster@pobox.com> writes:
Show 18 quoted lines
> "Kyle J. McKay" <mackyle@gmail.com> writes: > >> Hi guys, >> >> So I was looking at fetch-pack.c (from master @ 52cae643, but I think >> it's the same everywhere): >> > ... >> - hashcpy(ref->new_sha1, local); >> + hashcpy(ref->new_sha1, o->sha1); >> if (!args->verbose) >> continue; >> fprintf(stderr, >> "already have %s (%s)\n", sha1_to_hex(remote), >> ref->name); >> } >> return retval; >> ---
One thing I wonder is if this hashcpy() is doing anything useful, though. Is ref->new_sha1 used after we are done in this codepath, or is the reason nobody noticed it is because it does not matter whatever garbage is in that field nobody looks at it?