]> git.ipfire.org Git - thirdparty/git.git/blobdiff - submodule.c
object-store: migrate alternates struct and functions from cache.h
[thirdparty/git.git] / submodule.c
index 29677043174f8d77d6774bc2533b653d03adf990..b03e5f50458efdee9f26ac61982cf07e035e272e 100644 (file)
@@ -21,6 +21,7 @@
 #include "remote.h"
 #include "worktree.h"
 #include "parse-options.h"
+#include "object-store.h"
 
 static int config_update_recurse_submodules = RECURSE_SUBMODULES_OFF;
 static struct string_list changed_submodule_names = STRING_LIST_INIT_DUP;
@@ -1657,7 +1658,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)) {