Skip to content

Commit 431acd2

Browse files
peffgitster
authored andcommitted
t7415: don't bother creating commit for symlink test
Early versions of the fsck .gitmodules detection code actually required a tree to be at the root of a commit for it to be checked for .gitmodules. What we ended up with in 159e7b0 (fsck: detect gitmodules files, 2018-05-02), though, finds a .gitmodules file in _any_ tree (see that commit for more discussion). As a result, there's no need to create a commit in our tests. Let's drop it in the name of simplicity. And since that was the only thing referencing $tree, we can pull our tree creation out of a command substitution. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b7b1fca commit 431acd2

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

t/t7415-submodule-names.sh

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -135,13 +135,10 @@ test_expect_success 'fsck detects symlinked .gitmodules file' '
135135
tricky="[foo]bar=true" &&
136136
content=$(git hash-object -w ../.gitmodules) &&
137137
target=$(printf "$tricky" | git hash-object -w --stdin) &&
138-
tree=$(
139-
{
140-
printf "100644 blob $content\t$tricky\n" &&
141-
printf "120000 blob $target\t.gitmodules\n"
142-
} | git mktree
143-
) &&
144-
commit=$(git commit-tree $tree) &&
138+
{
139+
printf "100644 blob $content\t$tricky\n" &&
140+
printf "120000 blob $target\t.gitmodules\n"
141+
} | git mktree &&
145142
146143
# Check not only that we fail, but that it is due to the
147144
# symlink detector; this grep string comes from the config

0 commit comments

Comments
 (0)