@matheusbsbs / matheus-bagliano / commits / 3595d10c26
Fork 0

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 <liu.denton@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Denton Liu committed Dec 20, 2019 at 10:15 UTC 3595d10c26db483239d97ca8fc435c1c9dabcfb1
1 file changed +4 -4
t/t1306-xdg-files.sh
+4 -4
@@ -153,7 +153,7 @@ test_expect_success 'Checking attributes in both XDG and local attributes files'
153
154
155 test_expect_success 'Checking attributes in a non-XDG global attributes file' '
156 - test_might_fail rm .gitattributes &&
156 + rm -f .gitattributes &&
157 echo "f attr_f=test" >"$HOME"/my_gitattributes &&
158 git config core.attributesfile "$HOME"/my_gitattributes &&
159 echo "f: attr_f: test" >expected &&
@@ -165,7 +165,7 @@ test_expect_success 'Checking attributes in a non-XDG global attributes file' '
165 test_expect_success 'write: xdg file exists and ~/.gitconfig doesn'\''t' '
166 mkdir -p "$HOME"/.config/git &&
167 >"$HOME"/.config/git/config &&
168 - test_might_fail rm "$HOME"/.gitconfig &&
168 + rm -f "$HOME"/.gitconfig &&
169 git config --global user.name "write_config" &&
170 echo "[user]" >expected &&
171 echo " name = write_config" >>expected &&
@@ -183,8 +183,8 @@ test_expect_success 'write: xdg file exists and ~/.gitconfig exists' '
183
184
185 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 &&
188 git config --global user.name "write_gitconfig" &&
189 echo "[user]" >expected &&
190 echo " name = write_gitconfig" >>expected &&