summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Jeff King <peff@peff.net>2018-06-11 04:35:40 -0400
committerLibravatar Junio C Hamano <gitster@pobox.com>2018-06-11 10:56:04 -0700
commit431acd2de89ad5ec0a3e6ae6141e699c4a824ae1 (patch)
tree1399391ccb59a8cc11a142dc0461b5d394d42203 /t
parentfsck: complain when .gitmodules is a symlink (diff)
downloadtgif-431acd2de89ad5ec0a3e6ae6141e699c4a824ae1.tar.xz
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 159e7b080b (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 <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t7415-submodule-names.sh11
1 files changed, 4 insertions, 7 deletions
diff --git a/t/t7415-submodule-names.sh b/t/t7415-submodule-names.sh
index a770d92a55..541bd81684 100755
--- a/t/t7415-submodule-names.sh
+++ b/t/t7415-submodule-names.sh
@@ -135,13 +135,10 @@ test_expect_success 'fsck detects symlinked .gitmodules file' '
tricky="[foo]bar=true" &&
content=$(git hash-object -w ../.gitmodules) &&
target=$(printf "$tricky" | git hash-object -w --stdin) &&
- tree=$(
- {
- printf "100644 blob $content\t$tricky\n" &&
- printf "120000 blob $target\t.gitmodules\n"
- } | git mktree
- ) &&
- commit=$(git commit-tree $tree) &&
+ {
+ printf "100644 blob $content\t$tricky\n" &&
+ printf "120000 blob $target\t.gitmodules\n"
+ } | git mktree &&
# Check not only that we fail, but that it is due to the
# symlink detector; this grep string comes from the config