sha1-name: check for overflow of N in "foo^N" and "foo~N"
authorRené Scharfe <l.s.r@web.de>
Sun, 15 Sep 2019 12:10:28 +0000 (14:10 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 16 Sep 2019 19:50:33 +0000 (12:50 -0700)
commit59fa5f5a25d9ccc57558ac44cce83d37ac1cec58
treee2fa7a954b44962ce6696c5be7f57349828e65e3
parenta678df1bf928caeeef642ef07f73484a580fea57
sha1-name: check for overflow of N in "foo^N" and "foo~N"

Reject values that don't fit into an int, as get_parent() and
get_nth_ancestor() cannot handle them.  That's better than potentially
returning a random object.

If this restriction turns out to be too tight then we can switch to a
wider data type, but we'd still have to check for overflow.

Signed-off-by: René Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sha1-name.c
t/t1506-rev-parse-diagnosis.sh