]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t7814-grep-recurse-submodules.sh
sha1-file: split OBJECT_INFO_FOR_PREFETCH
[thirdparty/git.git] / t / t7814-grep-recurse-submodules.sh
index 7184113b9b2b381a6e7e0def8a8c1ba06771f8a6..fa475d52fa32bc257a215573943c84df6532bc8d 100755 (executable)
@@ -380,4 +380,20 @@ test_expect_success 'grep --recurse-submodules should pass the pattern type alon
        fi
 '
 
+# Recursing down into nested submodules which do not have .gitmodules in their
+# working tree does not work yet. This is because config_from_gitmodules()
+# uses get_oid() and the latter is still not able to get objects from an
+# arbitrary repository (the nested submodule, in this case).
+test_expect_failure 'grep --recurse-submodules with submodules without .gitmodules in the working tree' '
+       test_when_finished "git -C submodule checkout .gitmodules" &&
+       rm submodule/.gitmodules &&
+       git grep --recurse-submodules -e "(.|.)[\d]" >actual &&
+       cat >expect <<-\EOF &&
+       a:(1|2)d(3|4)
+       submodule/a:(1|2)d(3|4)
+       submodule/sub/a:(1|2)d(3|4)
+       EOF
+       test_cmp expect actual
+'
+
 test_done