diff options
author | Jeff King <peff@peff.net> | 2016-09-26 08:00:04 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-09-26 11:46:39 -0700 |
commit | 0016043bf46f4b85054c61f9000ccc58d0ef4ad7 (patch) | |
tree | 070243d7f87b4c4ac9f93006f2c40c7138bee83b /t/t5515/fetch.br-branches-default_branches-default | |
parent | get_short_sha1: parse tags when looking for treeish (diff) | |
download | tgif-0016043bf46f4b85054c61f9000ccc58d0ef4ad7.tar.xz |
get_short_sha1: refactor init of disambiguation code
The disambiguation machinery has two callers: get_short_sha1
and for_each_abbrev. Both need to repeat much of the same
setup: declaring buffers, sanity-checking lengths, preparing
the prefixes, etc. Let's pull that into a single init
function so we can avoid repeating ourselves.
Pulling the buffers into the "struct disambiguate_state"
isn't strictly necessary, but it does make things simpler
for the callers, who no longer have to worry about sizing
them correctly (i.e., it's an implicit requirement that
the caller provide 20- and 40-byte buffers).
And while we're touching this code, we can convert any
magic-number sizes to the more modern GIT_SHA1_* constants.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5515/fetch.br-branches-default_branches-default')
0 files changed, 0 insertions, 0 deletions