summaryrefslogtreecommitdiff
path: root/submodule.c
diff options
context:
space:
mode:
Diffstat (limited to 'submodule.c')
-rw-r--r--submodule.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/submodule.c b/submodule.c
index 2967704317..47ddc9b273 100644
--- a/submodule.c
+++ b/submodule.c
@@ -1657,7 +1657,9 @@ int submodule_move_head(const char *path,
else
argv_array_push(&cp.args, "-m");
- argv_array_push(&cp.args, old ? old : EMPTY_TREE_SHA1_HEX);
+ if (!(flags & SUBMODULE_MOVE_HEAD_FORCE))
+ argv_array_push(&cp.args, old ? old : EMPTY_TREE_SHA1_HEX);
+
argv_array_push(&cp.args, new ? new : EMPTY_TREE_SHA1_HEX);
if (run_command(&cp)) {