diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-06-13 12:50:44 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-06-13 12:50:44 -0700 |
commit | fb6ac9e79ae47aa55bb1c8b151afa770abd2a601 (patch) | |
tree | 315da2150b746c83a648741bf87c915194e5292c /t | |
parent | RelNotes 2.18: clarify where directory rename detection applies (diff) | |
parent | fsck: avoid looking at NULL blob->object (diff) | |
download | tgif-fb6ac9e79ae47aa55bb1c8b151afa770abd2a601.tar.xz |
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-x | t/t7415-submodule-names.sh | 29 |
1 files changed, 22 insertions, 7 deletions
diff --git a/t/t7415-submodule-names.sh b/t/t7415-submodule-names.sh index a770d92a55..3c0f1a102a 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 |