Skip to content

Commit ce153b8

Browse files
sunshinecogitster
authored andcommitted
t1509: make "setup" test more robust
One of the t1509 setup tests is very particular about the output it expects from `git init`, and fails if the output differs even slightly which can happen easily if the script is run multiple times since it doesn't do a good job of cleaning up after itself (i.e. it leaves detritus in the root directory `/`). One bit of cruft in particular (`/HEAD`) makes the test fail since its presence causes `git init` to alter its output; rather than reporting "Initialized empty Git repository", it instead reports "Reinitialized existing Git repository" when `/HEAD` is present. Address this problem by making the test do a more careful job of crafting its intended initial state. Signed-off-by: Eric Sunshine <[email protected]>
1 parent 7790b8c commit ce153b8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

t/t1509-root-work-tree.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ say "auto bare gitdir"
243243
# DESTROYYYYY!!!!!
244244
test_expect_success 'setup' '
245245
rm -rf /refs /objects /info /hooks &&
246-
rm -f /expected /ls.expected /me /result &&
246+
rm -f /HEAD /expected /ls.expected /me /result &&
247247
cd / &&
248248
echo "Initialized empty Git repository in /" > expected &&
249249
git init --bare > result &&

0 commit comments

Comments
 (0)