Skip to content

Commit 89a70b8

Browse files
dschogitster
authored andcommitted
t0302 & t3900: add forgotten quotes
When cleaning up files in the $HOME directory, it really makes sense to quote the path, especially in Git's test suite, where the HOME directory is *guaranteed* to contain spaces in its name. It would appear that those two tests pass even without cleaning up the files, but really more by pure chance than by design (the cleanup seems not actually to be necessary). However, if anybody would have a left-over `trash/` directory in Git's `t/` directory, these tests would fail, because they would all of a sudden try to delete that directory, but without the `-r` (recursive) flag. That is how this issue was found. Signed-off-by: Johannes Schindelin <[email protected]> Reviewed-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 567c53d commit 89a70b8

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

t/t0302-credential-store.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ helper_test store
3737
unset XDG_CONFIG_HOME
3838

3939
test_expect_success 'if custom xdg file exists, home and xdg files not created' '
40-
test_when_finished "rm -f $HOME/xdg/git/credentials" &&
40+
test_when_finished "rm -f \"$HOME/xdg/git/credentials\"" &&
4141
test -s "$HOME/xdg/git/credentials" &&
4242
test_path_is_missing "$HOME/.git-credentials" &&
4343
test_path_is_missing "$HOME/.config/git/credentials"

t/t3900-i18n-commit.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ test_expect_success 'UTF-16 refused because of NULs' '
4040
'
4141

4242
test_expect_success 'UTF-8 invalid characters refused' '
43-
test_when_finished "rm -f $HOME/stderr $HOME/invalid" &&
43+
test_when_finished "rm -f \"$HOME/stderr $HOME/invalid\"" &&
4444
echo "UTF-8 characters" >F &&
4545
printf "Commit message\n\nInvalid surrogate:\355\240\200\n" \
4646
>"$HOME/invalid" &&
@@ -49,7 +49,7 @@ test_expect_success 'UTF-8 invalid characters refused' '
4949
'
5050

5151
test_expect_success 'UTF-8 overlong sequences rejected' '
52-
test_when_finished "rm -f $HOME/stderr $HOME/invalid" &&
52+
test_when_finished "rm -f \"$HOME/stderr $HOME/invalid\"" &&
5353
rm -f "$HOME/stderr" "$HOME/invalid" &&
5454
echo "UTF-8 overlong" >F &&
5555
printf "\340\202\251ommit message\n\nThis is not a space:\300\240\n" \
@@ -59,7 +59,7 @@ test_expect_success 'UTF-8 overlong sequences rejected' '
5959
'
6060

6161
test_expect_success 'UTF-8 non-characters refused' '
62-
test_when_finished "rm -f $HOME/stderr $HOME/invalid" &&
62+
test_when_finished "rm -f \"$HOME/stderr $HOME/invalid\"" &&
6363
echo "UTF-8 non-character 1" >F &&
6464
printf "Commit message\n\nNon-character:\364\217\277\276\n" \
6565
>"$HOME/invalid" &&
@@ -68,7 +68,7 @@ test_expect_success 'UTF-8 non-characters refused' '
6868
'
6969

7070
test_expect_success 'UTF-8 non-characters refused' '
71-
test_when_finished "rm -f $HOME/stderr $HOME/invalid" &&
71+
test_when_finished "rm -f \"$HOME/stderr $HOME/invalid\"" &&
7272
echo "UTF-8 non-character 2." >F &&
7373
printf "Commit message\n\nNon-character:\357\267\220\n" \
7474
>"$HOME/invalid" &&

0 commit comments

Comments
 (0)