summaryrefslogtreecommitdiff
path: root/compat
diff options
context:
space:
mode:
authorLibravatar Jeff King <peff@peff.net>2016-09-26 07:59:01 -0400
committerLibravatar Junio C Hamano <gitster@pobox.com>2016-09-26 11:21:28 -0700
commit259942f549eb235e9d7d095c2db8f3dc279f3958 (patch)
tree18bd433040d80c907bc2b0d34403c3b88ac76481 /compat
parentFourth batch for 2.11 (diff)
downloadtgif-259942f549eb235e9d7d095c2db8f3dc279f3958.tar.xz
get_sha1: detect buggy calls with multiple disambiguators
The get_sha1() family of functions takes a flags field, but some of the flags are mutually exclusive. In particular, we can only handle one disambiguating function, and the flags quietly override each other. Let's instead detect these as programming bugs. Technically some of the flags are supersets of the others, so treating COMMITTISH|TREEISH as just COMMITTISH is not wrong, but it's a good sign the caller is confused. And certainly asking for BLOB|TREE does not work. We can do the check easily with some bit-twiddling, and as a bonus, the bit-mask of disambiguators will come in handy in a future patch. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'compat')
0 files changed, 0 insertions, 0 deletions