Skip to content

Commit 18f3b5a

Browse files
Michael J Grubergitster
authored andcommitted
t7508: test advice.statusHints
edf563f (status: make "how to stage" messages optional, 2009-09-09) introduced advice.statusHints without tests. Add a few tests to describe and test the status quo. Signed-off-by: Michael J Gruber <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d599e04 commit 18f3b5a

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

t/t7508-status.sh

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,34 @@ test_expect_success 'status (2)' '
6868
6969
'
7070

71+
cat >expect <<\EOF
72+
# On branch master
73+
# Changes to be committed:
74+
# new file: dir2/added
75+
#
76+
# Changed but not updated:
77+
# modified: dir1/modified
78+
#
79+
# Untracked files:
80+
# dir1/untracked
81+
# dir2/modified
82+
# dir2/untracked
83+
# expect
84+
# output
85+
# untracked
86+
EOF
87+
88+
git config advice.statusHints false
89+
90+
test_expect_success 'status (advice.statusHints false)' '
91+
92+
git status >output &&
93+
test_cmp expect output
94+
95+
'
96+
97+
git config --unset advice.statusHints
98+
7199
cat >expect <<\EOF
72100
M dir1/modified
73101
A dir2/added
@@ -115,6 +143,23 @@ test_expect_success 'status (status.showUntrackedFiles no)' '
115143
test_cmp expect output
116144
'
117145

146+
cat >expect <<EOF
147+
# On branch master
148+
# Changes to be committed:
149+
# new file: dir2/added
150+
#
151+
# Changed but not updated:
152+
# modified: dir1/modified
153+
#
154+
# Untracked files not listed (use -u option to show untracked files)
155+
EOF
156+
git config advice.statusHints false
157+
test_expect_success 'status -uno (advice.statusHints false)' '
158+
git status -uno >output &&
159+
test_cmp expect output
160+
'
161+
git config --unset advice.statusHints
162+
118163
cat >expect << EOF
119164
M dir1/modified
120165
A dir2/added

0 commit comments

Comments
 (0)