]> git.ipfire.org Git - thirdparty/git.git/commit - t/t1506-rev-parse-diagnosis.sh
rev-parse: demonstrate overflow of N for "foo^N" and "foo~N"
authorRené Scharfe <l.s.r@web.de>
Sun, 15 Sep 2019 12:03:25 +0000 (14:03 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 16 Sep 2019 19:50:27 +0000 (12:50 -0700)
commita678df1bf928caeeef642ef07f73484a580fea57
tree8819f7bf7cf61d6c5964e86bc7f7c173d11ae4d8
parent75b2f01a0f642b39b0f29b6218515df9b5eb798e
rev-parse: demonstrate overflow of N for "foo^N" and "foo~N"

If the number gets too high for an int, weird things may happen, as
signed overflows are undefined.  Add a test to show this; rev-parse
"sucessfully" interprets 100000000000000000000000000000000 to be the
same as 0, at least on x64 with GCC 9.2.1 and Clang 8.0.1, which is
obviously bogus.

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