]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t1511-rev-parse-caret.sh
t3905: move all commands into test cases
[thirdparty/git.git] / t / t1511-rev-parse-caret.sh
index e0a49a651fdd3b3f7d9e0f24e00439c9642f896c..6ecfed86bc0d6aa6390f09dd3a06976208d3f8cb 100755 (executable)
@@ -2,6 +2,9 @@
 
 test_description='tests for ref^{stuff}'
 
+GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
+export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+
 . ./test-lib.sh
 
 test_expect_success 'setup' '
@@ -15,7 +18,7 @@ test_expect_success 'setup' '
        git commit -m Initial &&
        git tag -a -m commit commit-tag &&
        git branch ref &&
-       git checkout master &&
+       git checkout main &&
        echo modified >>a-blob &&
        git add -u &&
        git commit -m Modified &&
@@ -73,52 +76,52 @@ test_expect_success 'ref^{tag}' '
 '
 
 test_expect_success 'ref^{/.}' '
-       git rev-parse master >expected &&
-       git rev-parse master^{/.} >actual &&
+       git rev-parse main >expected &&
+       git rev-parse main^{/.} >actual &&
        test_cmp expected actual
 '
 
 test_expect_success 'ref^{/non-existent}' '
-       test_must_fail git rev-parse master^{/non-existent}
+       test_must_fail git rev-parse main^{/non-existent}
 '
 
 test_expect_success 'ref^{/Initial}' '
        git rev-parse ref >expected &&
-       git rev-parse master^{/Initial} >actual &&
+       git rev-parse main^{/Initial} >actual &&
        test_cmp expected actual
 '
 
 test_expect_success 'ref^{/!Exp}' '
-       test_must_fail git rev-parse master^{/!Exp}
+       test_must_fail git rev-parse main^{/!Exp}
 '
 
 test_expect_success 'ref^{/!}' '
-       test_must_fail git rev-parse master^{/!}
+       test_must_fail git rev-parse main^{/!}
 '
 
 test_expect_success 'ref^{/!!Exp}' '
        git rev-parse expref >expected &&
-       git rev-parse master^{/!!Exp} >actual &&
+       git rev-parse main^{/!!Exp} >actual &&
        test_cmp expected actual
 '
 
 test_expect_success 'ref^{/!-}' '
-       test_must_fail git rev-parse master^{/!-}
+       test_must_fail git rev-parse main^{/!-}
 '
 
 test_expect_success 'ref^{/!-.}' '
-       test_must_fail git rev-parse master^{/!-.}
+       test_must_fail git rev-parse main^{/!-.}
 '
 
 test_expect_success 'ref^{/!-non-existent}' '
-       git rev-parse master >expected &&
-       git rev-parse master^{/!-non-existent} >actual &&
+       git rev-parse main >expected &&
+       git rev-parse main^{/!-non-existent} >actual &&
        test_cmp expected actual
 '
 
 test_expect_success 'ref^{/!-Changed}' '
        git rev-parse expref >expected &&
-       git rev-parse master^{/!-Changed} >actual &&
+       git rev-parse main^{/!-Changed} >actual &&
        test_cmp expected actual
 '