diff options
author | Jeff King <peff@peff.net> | 2016-09-26 07:59:41 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-09-26 11:46:30 -0700 |
commit | 8a10fea49b1f95daeea445072a60139590b216cf (patch) | |
tree | 6af8d5fb5afc4a9e0bda1e6f65de4663f6311b86 /t/t2017-checkout-orphan.sh | |
parent | get_sha1: avoid repeating ourselves via ONLY_TO_DIE (diff) | |
download | tgif-8a10fea49b1f95daeea445072a60139590b216cf.tar.xz |
get_sha1: propagate flags to child functions
The get_sha1() function is actually implementation by many
sub-functions, but we do not always pass our flags around to
all of those functions. As a result, we may forget that our
caller asked us to resolve with GET_SHA1_QUIETLY and output
messages. The two triggerable cases are:
1. Resolving treeish:path will resolve the "treeish"
portion using GET_SHA1_TREEISH, dropping all other
flags.
2. The peel_onion() function did not take flags at all
but recurses to get_sha1_1(), which does.
The solution for both is to bitwise-OR their new flags with
the existing ones (after dropping any mutually exclusive
disambiguation flags).
This bug can trigger with "git rev-parse --quiet", which
asks for quiet resolution. But it can also happen in a more
vanilla code path when we do a follow-up ONLY_TO_DIE
invocation of get_sha1(), and that's what the tests check.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t2017-checkout-orphan.sh')
0 files changed, 0 insertions, 0 deletions