]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t1511-rev-parse-caret.sh
test for '!' handling in rev-parse's named commits
[thirdparty/git.git] / t / t1511-rev-parse-caret.sh
index 15973f20945769fd7661cd4b203e96032495a60e..b2f90bea6a8d353842e059e102f8f93d117e4266 100755 (executable)
@@ -18,7 +18,15 @@ test_expect_success 'setup' '
        git checkout master &&
        echo modified >>a-blob &&
        git add -u &&
-       git commit -m Modified
+       git commit -m Modified &&
+       git branch modref &&
+       echo changed! >>a-blob &&
+       git add -u &&
+       git commit -m !Exp &&
+       git branch expref &&
+       echo changed >>a-blob &&
+       git add -u &&
+       git commit -m Changed
 '
 
 test_expect_success 'ref^{non-existent}' '
@@ -77,4 +85,18 @@ test_expect_success 'ref^{/Initial}' '
        test_cmp expected actual
 '
 
+test_expect_success 'ref^{/!Exp}' '
+       test_must_fail git rev-parse master^{/!Exp}
+'
+
+test_expect_success 'ref^{/!}' '
+       test_must_fail git rev-parse master^{/!}
+'
+
+test_expect_success 'ref^{/!!Exp}' '
+       git rev-parse expref >expected &&
+       git rev-parse master^{/!!Exp} >actual &&
+       test_cmp expected actual
+'
+
 test_done