Skip to content

Commit 7a74690

Browse files
pks-tgitster
authored andcommitted
t5526: break test submodule differently
In 10f5c52 (submodule: avoid auto-discovery in prepare_submodule_repo_env(), 2016-09-01) we fixed a bug when doing a recursive fetch with submodule in the case where the submodule is broken due to whatever reason. The test to exercise that the fix works breaks the submodule by deleting its `HEAD` reference, which will cause us to not detect the directory as a Git repository. While this is perfectly fine in theory, this way of breaking the repo becomes problematic with the current efforts to introduce another refdb backend into Git. The new reftable backend has a stub HEAD file that always contains "ref: refs/heads/.invalid" so that tools continue to be able to detect such a repository. But as the reftable backend will never delete this file even when asked to delete `HEAD` the current way to delete the `HEAD` reference will stop working. Adapt the code to instead delete the objects database. Going back with this new way to cause breakage confirms that it triggers the infinite recursion just the same, and there are no equivalent ongoing efforts to replace the object database with an alternate backend. Signed-off-by: Patrick Steinhardt <[email protected]> Reviewed-by: Christian Couder <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 61e1c56 commit 7a74690

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

t/t5526-fetch-submodules.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -771,7 +771,7 @@ test_expect_success 'fetching submodule into a broken repository' '
771771
git -C dst fetch --recurse-submodules &&
772772
773773
# Break the receiving submodule
774-
test-tool -C dst/sub ref-store main delete-refs REF_NO_DEREF msg HEAD &&
774+
rm -r dst/sub/.git/objects &&
775775
776776
# NOTE: without the fix the following tests will recurse forever!
777777
# They should terminate with an error.

0 commit comments

Comments
 (0)