summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-06-13 19:50:44 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-06-13 19:50:44 (GMT)
commitfb6ac9e79ae47aa55bb1c8b151afa770abd2a601 (patch)
tree315da2150b746c83a648741bf87c915194e5292c /t
parentb2453d34496cb62b9c63c7a7c9b4bead2431f715 (diff)
parent47cc91310a81ca606e6bebcccf168bc1cb297d8e (diff)
downloadgit-fb6ac9e79ae47aa55bb1c8b151afa770abd2a601.zip
git-fb6ac9e79ae47aa55bb1c8b151afa770abd2a601.tar.gz
git-fb6ac9e79ae47aa55bb1c8b151afa770abd2a601.tar.bz2
Merge branch 'jk/submodule-fsck-loose-fixup'
Finishing touches to a topic that already is in 'maint'. * jk/submodule-fsck-loose-fixup: fsck: avoid looking at NULL blob->object t7415: don't bother creating commit for symlink test
Diffstat (limited to 't')
-rwxr-xr-xt/t7415-submodule-names.sh29
1 files changed, 22 insertions, 7 deletions
diff --git a/t/t7415-submodule-names.sh b/t/t7415-submodule-names.sh
index a770d92..3c0f1a1 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
@@ -151,4 +148,22 @@ test_expect_success 'fsck detects symlinked .gitmodules file' '
)
'
+test_expect_success 'fsck detects non-blob .gitmodules' '
+ git init non-blob &&
+ (
+ cd non-blob &&
+
+ # As above, make the funny tree directly to avoid index
+ # restrictions.
+ mkdir subdir &&
+ cp ../.gitmodules subdir/file &&
+ git add subdir/file &&
+ git commit -m ok &&
+ git ls-tree HEAD | sed s/subdir/.gitmodules/ | git mktree &&
+
+ test_must_fail git fsck 2>output &&
+ grep gitmodulesBlob output
+ )
+'
+
test_done