Merge branch 'ne/pack-local-doc' into maint
[gitweb.git] / builtin-push.c
index 28a26e7db2a86bf1514cdd54f9735c0be146dce7..5633f0ade49f7c845665b7aab202be18a8cc9d8d 100644 (file)
@@ -52,7 +52,7 @@ static void set_refspecs(const char **refs, int nr)
                } else if (deleterefs && !strchr(ref, ':')) {
                        char *delref;
                        int len = strlen(ref)+1;
-                       delref = xmalloc(len);
+                       delref = xmalloc(len+1);
                        strcpy(delref, ":");
                        strcat(delref, ref);
                        ref = delref;
@@ -218,6 +218,8 @@ int cmd_push(int argc, const char **argv, const char *prefix)
                OPT_BOOLEAN( 0 , "thin", &thin, "use thin pack"),
                OPT_STRING( 0 , "receive-pack", &receivepack, "receive-pack", "receive pack program"),
                OPT_STRING( 0 , "exec", &receivepack, "receive-pack", "receive pack program"),
+               OPT_BIT('u', "set-upstream", &flags, "set upstream for git pull/status",
+                       TRANSPORT_PUSH_SET_UPSTREAM),
                OPT_END()
        };