Code

git-gc: always use -A when manually repacking
[git.git] / builtin-remote.c
index a3ee1ac3937b179799fbaa048927c4c8a9963cc9..8b63619ef08a2ac3d96000908fe4986396ddd6a2 100644 (file)
@@ -107,6 +107,7 @@ static int add(int argc, const char **argv)
                struct path_list_item *item = track.items + i;
 
                strbuf_reset(&buf2);
+               strbuf_addch(&buf2, '+');
                if (mirror)
                        strbuf_addf(&buf2, "refs/%s:refs/%s",
                                        item->path, item->path);
@@ -117,6 +118,13 @@ static int add(int argc, const char **argv)
                        return 1;
        }
 
+       if (mirror) {
+               strbuf_reset(&buf);
+               strbuf_addf(&buf, "remote.%s.mirror", name);
+               if (git_config_set(buf.buf, "yes"))
+                       return 1;
+       }
+
        if (fetch && fetch_remote(name))
                return 1;