path: root/t
diff options
authorDavid Turner <>2020-01-27 18:58:56 (GMT)
committerJunio C Hamano <>2020-01-28 22:46:14 (GMT)
commit7edee32985b1363e35e91c7358a9e60f2359fbba (patch)
tree310ef2b2ad2ce63815394522aef736b648743528 /t
parenta0ba80001a42eeacae94e3503c3e7d4bf7f2f2e1 (diff)
git rm submodule: succeed if .gitmodules index stat info is zero
The bug was that ie_match_stat() was used to compare if the stat info for the file was compatible with the stat info in the index, rather using ie_modified() to check if the file was in fact different from the version in the index. A version of this (with deinit instead of rm) was reported here: It seems that in that case, the user's clone command left the index with empty stat info. The mailing list was unable to reproduce this. But we (Two Sigma) hit the bug while using some plumbing commands, so I'm fixing it. I manually confirmed that the fix also repairs deinit in this scenario. Signed-off-by: David Turner <> Reported-by: Thomas B├ętous <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 't')
1 files changed, 7 insertions, 0 deletions
diff --git a/t/ b/t/
index 0ea858d..f2c0168 100755
--- a/t/
+++ b/t/
@@ -425,6 +425,13 @@ test_expect_success 'rm will error out on a modified .gitmodules file unless sta
git status -s -uno >actual &&
test_cmp expect actual
+test_expect_success 'rm will not error out on .gitmodules file with zero stat data' '
+ git reset --hard &&
+ git submodule update &&
+ git read-tree HEAD &&
+ git rm submod &&
+ test_path_is_missing submod
test_expect_success 'rm issues a warning when section is not found in .gitmodules' '
git reset --hard &&