Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2019-09-15 15:10:28 +0300
committerJunio C Hamano <gitster@pobox.com>2019-09-16 22:50:33 +0300
commit59fa5f5a25d9ccc57558ac44cce83d37ac1cec58 (patch)
treee2fa7a954b44962ce6696c5be7f57349828e65e3 /t/t1506-rev-parse-diagnosis.sh
parenta678df1bf928caeeef642ef07f73484a580fea57 (diff)
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>
Diffstat (limited to 't/t1506-rev-parse-diagnosis.sh')
-rwxr-xr-xt/t1506-rev-parse-diagnosis.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/t/t1506-rev-parse-diagnosis.sh b/t/t1506-rev-parse-diagnosis.sh
index 5c4df47401..6a938b205b 100755
--- a/t/t1506-rev-parse-diagnosis.sh
+++ b/t/t1506-rev-parse-diagnosis.sh
@@ -215,11 +215,11 @@ test_expect_success 'arg before dashdash must be a revision (ambiguous)' '
test_cmp expect actual
'
-test_expect_failure 'reject Nth parent if N is too high' '
+test_expect_success 'reject Nth parent if N is too high' '
test_must_fail git rev-parse HEAD^100000000000000000000000000000000
'
-test_expect_failure 'reject Nth ancestor if N is too high' '
+test_expect_success 'reject Nth ancestor if N is too high' '
test_must_fail git rev-parse HEAD~100000000000000000000000000000000
'