Re: [PATCH 2/2] tag: convert gpg_verify_tag to use struct object_id
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jul 13, 2017, 19:02 UTC
- Message-ID
- <xmqqzic8w472.fsf@gitster.mtv.corp.google.com>
- In-Reply-To
- <20170713004415.5051-2-sbeller@google.com>
Stefan Beller <sbeller@google.com> writes:
> if (fmt_pretty) > - pretty_print_ref(name, sha1, fmt_pretty); > + pretty_print_ref(name, oid.hash, fmt_pretty);
The next step would be to have pretty_print_ref() to take an oid; as there are only two callers to it, both of which pass oid->hash to it, that should be a small and conflict-free conversion.
> > - type = sha1_object_info(sha1, NULL); > + type = sha1_object_info(oid->hash, NULL);
sha1_object_info() has a handful of callers that do not pass the pointer to the hash field in an existing oid object, but it does not look too bad as a candidate for conversion.
Show 6 quoted lines
> if (!buf)
> return error("%s: unable to read file.",
> name_to_report ?
> name_to_report :
> - find_unique_abbrev(sha1, DEFAULT_ABBREV));
> + find_unique_abbrev(oid->hash, DEFAULT_ABBREV));So does find_unique_abbrev().
Overall both patches look good. Thanks.