]> git.ipfire.org Git - thirdparty/git.git/blobdiff - remote-curl.c
Merge branch 'rs/clear-commit-marks-in-repo'
[thirdparty/git.git] / remote-curl.c
index 32cc4a0c553b3e6f953be247bd593e07222dd5b5..0290b04891596bd4ebed0154c25b0713acd30d08 100644 (file)
@@ -44,7 +44,8 @@ struct options {
                from_promisor : 1,
 
                atomic : 1,
-               object_format : 1;
+               object_format : 1,
+               force_if_includes : 1;
        const struct git_hash_algo *hash_algo;
 };
 static struct options options;
@@ -131,6 +132,14 @@ static int set_option(const char *name, const char *value)
                string_list_append(&cas_options, val.buf);
                strbuf_release(&val);
                return 0;
+       } else if (!strcmp(name, TRANS_OPT_FORCE_IF_INCLUDES)) {
+               if (!strcmp(value, "true"))
+                       options.force_if_includes = 1;
+               else if (!strcmp(value, "false"))
+                       options.force_if_includes = 0;
+               else
+                       return -1;
+               return 0;
        } else if (!strcmp(name, "cloning")) {
                if (!strcmp(value, "true"))
                        options.cloning = 1;
@@ -1318,6 +1327,9 @@ static int push_git(struct discovery *heads, int nr_spec, const char **specs)
                strvec_push(&args, cas_option->string);
        strvec_push(&args, url.buf);
 
+       if (options.force_if_includes)
+               strvec_push(&args, "--force-if-includes");
+
        strvec_push(&args, "--stdin");
        for (i = 0; i < nr_spec; i++)
                packet_buf_write(&preamble, "%s\n", specs[i]);