]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t1506-rev-parse-diagnosis.sh
t1506: rev-parse A..B and A...B
[thirdparty/git.git] / t / t1506-rev-parse-diagnosis.sh
index dbf690b9c1ba492dff629ac75c9cadd5d4887095..3e657e693b272dec5711593ae85eec7c6725b9dc 100755 (executable)
@@ -190,6 +190,24 @@ test_expect_success 'dotdot is not an empty set' '
        test_cmp expect actual
 '
 
+test_expect_success 'dotdot does not peel endpoints' '
+       git tag -a -m "annote" annotated HEAD &&
+       A=$(git rev-parse annotated) &&
+       H=$(git rev-parse annotated^0) &&
+       {
+               echo $A && echo ^$A
+       } >expect-with-two-dots &&
+       {
+               echo $A && echo $A && echo ^$H
+       } >expect-with-merge-base &&
+
+       git rev-parse annotated..annotated >actual-with-two-dots &&
+       test_cmp expect-with-two-dots actual-with-two-dots &&
+
+       git rev-parse annotated...annotated >actual-with-merge-base &&
+       test_cmp expect-with-merge-base actual-with-merge-base
+'
+
 test_expect_success 'arg before dashdash must be a revision (missing)' '
        test_must_fail git rev-parse foobar -- 2>stderr &&
        test_i18ngrep "bad revision" stderr