path: root/builtin/update-index.c
diff options
authorHeiko Voigt <>2012-06-09 14:27:00 (GMT)
committerJunio C Hamano <>2012-06-11 15:00:11 (GMT)
commit242f55f61252e610092e93f4b2daebba21cb8acf (patch)
tree05f8086bfab70dfd15e2d99fdc4d4d96c5b89c54 /builtin/update-index.c
parent121f71f0da1bc9a4e1e96be2c3e683191a82a354 (diff)
update-index: allow overwriting existing submodule index entries
In commit e01105 Linus introduced gitlinks to update-index. He explains that he thinks it is not the right thing to replace a gitlink with something else. That commit is from the very first beginnings of submodule support. Since then we have gotten a lot closer to being able to remove a submodule without losing its history. This check prevents such a use case, so I think this assumption has changed. Additionally in the git add codepath we do not have such a check, so for consistency reasons I think removing this check is the correct thing to do. Signed-off-by: Heiko Voigt <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'builtin/update-index.c')
1 files changed, 0 insertions, 6 deletions
diff --git a/builtin/update-index.c b/builtin/update-index.c
index a6a23fa..9ffa62a 100644
--- a/builtin/update-index.c
+++ b/builtin/update-index.c
@@ -211,12 +211,6 @@ static int process_path(const char *path)
if (S_ISDIR(st.st_mode))
return process_directory(path, len, &st);
- /*
- * Process a regular file
- */
- if (ce && S_ISGITLINK(ce->ce_mode))
- return error("%s is already a gitlink, not replacing", path);
return add_one_path(ce, path, len, &st);