[PATCH 5/6] t1403: remove dependency on GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Phillip Wood <phillip.wood@xxxxxxxxxxxxx>

Some of the tests use GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME when
checking if a ref exists. However, as that variable is always set to
"main" at the start of the test file, we can hard code the name in the
tests in preparation for removing GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
in Git 3.0.

Signed-off-by: Phillip Wood <phillip.wood@xxxxxxxxxxxxx>
---
 t/t1403-show-ref.sh | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/t/t1403-show-ref.sh b/t/t1403-show-ref.sh
index 9da3650e91b..7b83daeaa32 100755
--- a/t/t1403-show-ref.sh
+++ b/t/t1403-show-ref.sh
@@ -229,15 +229,15 @@ test_expect_success 'show-ref sub-modes are mutually exclusive' '
 '
 
 test_expect_success '--exists with existing reference' '
-	git show-ref --exists refs/heads/$GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
+	git show-ref --exists refs/heads/main
 '
 
 test_expect_success '--exists with missing reference' '
 	test_expect_code 2 git show-ref --exists refs/heads/does-not-exist
 '
 
 test_expect_success '--exists does not use DWIM' '
-	test_expect_code 2 git show-ref --exists $GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME 2>err &&
+	test_expect_code 2 git show-ref --exists main 2>err &&
 	grep "reference does not exist" err
 '
 
@@ -254,7 +254,7 @@ test_expect_success '--exists with bad reference name' '
 
 test_expect_success '--exists with arbitrary symref' '
 	test_when_finished "git symbolic-ref -d refs/symref" &&
-	git symbolic-ref refs/symref refs/heads/$GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME &&
+	git symbolic-ref refs/symref refs/heads/main &&
 	git show-ref --exists refs/symref
 '
 
-- 
2.49.0.897.gfad3eb7d210





[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux