Skip to content

Commit cbdc83f

Browse files
committed
t0018: two small fixes
Even though the three tests that were recently added started their here-doc with "<<-\EOF", it did not take advantage of that and instead wrote the here-doc payload abut to the left edge. Use a tabs to indent these lines. More importantly, because these all hardcode the expected output, which contains the current branch name, they break the CI job that uses 'main' as the default branch name. Use GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=trunk export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME between the test_description line and ". ./test-lib.sh" line to force the initial branch name to 'trunk' and expect it to show in the output. Signed-off-by: Junio C Hamano <[email protected]>
1 parent b79deeb commit cbdc83f

File tree

1 file changed

+22
-19
lines changed

1 file changed

+22
-19
lines changed

t/t0018-advice.sh

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
test_description='Test advise_if_enabled functionality'
44

5+
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=trunk
6+
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
7+
58
TEST_PASSES_SANITIZE_LEAK=true
69
. ./test-lib.sh
710

@@ -31,15 +34,15 @@ test_expect_success 'advice should not be printed when config variable is set to
3134

3235
test_expect_success 'advice should not be printed when --no-advice is used' '
3336
q_to_tab >expect <<-\EOF &&
34-
On branch master
37+
On branch trunk
3538
36-
No commits yet
39+
No commits yet
3740
38-
Untracked files:
39-
QREADME
41+
Untracked files:
42+
QREADME
4043
41-
nothing added to commit but untracked files present
42-
EOF
44+
nothing added to commit but untracked files present
45+
EOF
4346
4447
test_when_finished "rm -fr advice-test" &&
4548
git init advice-test &&
@@ -53,15 +56,15 @@ EOF
5356

5457
test_expect_success 'advice should not be printed when GIT_ADVICE is set to false' '
5558
q_to_tab >expect <<-\EOF &&
56-
On branch master
59+
On branch trunk
5760
58-
No commits yet
61+
No commits yet
5962
60-
Untracked files:
61-
QREADME
63+
Untracked files:
64+
QREADME
6265
63-
nothing added to commit but untracked files present
64-
EOF
66+
nothing added to commit but untracked files present
67+
EOF
6568
6669
test_when_finished "rm -fr advice-test" &&
6770
git init advice-test &&
@@ -75,16 +78,16 @@ EOF
7578

7679
test_expect_success 'advice should be printed when GIT_ADVICE is set to true' '
7780
q_to_tab >expect <<-\EOF &&
78-
On branch master
81+
On branch trunk
7982
80-
No commits yet
83+
No commits yet
8184
82-
Untracked files:
83-
(use "git add <file>..." to include in what will be committed)
84-
QREADME
85+
Untracked files:
86+
(use "git add <file>..." to include in what will be committed)
87+
QREADME
8588
86-
nothing added to commit but untracked files present (use "git add" to track)
87-
EOF
89+
nothing added to commit but untracked files present (use "git add" to track)
90+
EOF
8891
8992
test_when_finished "rm -fr advice-test" &&
9093
git init advice-test &&

0 commit comments

Comments
 (0)