Skip to content

Commit 3595d10

Browse files
Denton-Lgitster
authored andcommitted
t1306: convert test_might_fail rm to rm -f
The test_must_fail() family of functions (including test_might_fail()) should only be used on git commands. Replace `test_might_fail rm` with `rm -f` so that we don't use `test_might_fail` on a non-git command. Signed-off-by: Denton Liu <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent f511bc0 commit 3595d10

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

t/t1306-xdg-files.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ test_expect_success 'Checking attributes in both XDG and local attributes files'
153153

154154

155155
test_expect_success 'Checking attributes in a non-XDG global attributes file' '
156-
test_might_fail rm .gitattributes &&
156+
rm -f .gitattributes &&
157157
echo "f attr_f=test" >"$HOME"/my_gitattributes &&
158158
git config core.attributesfile "$HOME"/my_gitattributes &&
159159
echo "f: attr_f: test" >expected &&
@@ -165,7 +165,7 @@ test_expect_success 'Checking attributes in a non-XDG global attributes file' '
165165
test_expect_success 'write: xdg file exists and ~/.gitconfig doesn'\''t' '
166166
mkdir -p "$HOME"/.config/git &&
167167
>"$HOME"/.config/git/config &&
168-
test_might_fail rm "$HOME"/.gitconfig &&
168+
rm -f "$HOME"/.gitconfig &&
169169
git config --global user.name "write_config" &&
170170
echo "[user]" >expected &&
171171
echo " name = write_config" >>expected &&
@@ -183,8 +183,8 @@ test_expect_success 'write: xdg file exists and ~/.gitconfig exists' '
183183

184184

185185
test_expect_success 'write: ~/.config/git/ exists and config file doesn'\''t' '
186-
test_might_fail rm "$HOME"/.gitconfig &&
187-
test_might_fail rm "$HOME"/.config/git/config &&
186+
rm -f "$HOME"/.gitconfig &&
187+
rm -f "$HOME"/.config/git/config &&
188188
git config --global user.name "write_gitconfig" &&
189189
echo "[user]" >expected &&
190190
echo " name = write_gitconfig" >>expected &&

0 commit comments

Comments
 (0)