t3404: use configured shell instead of /bin/sh
[gitweb.git] / builtin-push.c
index d49157c9262032329a8a0ad8fb898c2f739b8b8b..9f727c00f689ae23373502c7fb21b2234a1c1748 100644 (file)
@@ -44,6 +44,15 @@ static void set_refspecs(const char **refs, int nr)
                        strcat(tag, refs[i]);
                        ref = tag;
                }
+               if (!strcmp("HEAD", ref)) {
+                       unsigned char sha1_dummy[20];
+                       ref = resolve_ref(ref, sha1_dummy, 1, NULL);
+                       if (!ref)
+                               die("HEAD cannot be resolved.");
+                       if (prefixcmp(ref, "refs/heads/"))
+                               die("HEAD cannot be resolved to branch.");
+                       ref = xstrdup(ref + 11);
+               }
                add_refspec(ref);
        }
 }
@@ -81,7 +90,7 @@ static int do_push(const char *repo, int flags)
                if (!err)
                        continue;
 
-               error("failed to push to '%s'", remote->url[i]);
+               error("failed to push some refs to '%s'", remote->url[i]);
                errs++;
        }
        return !!errs;
@@ -117,6 +126,8 @@ int cmd_push(int argc, const char **argv, const char *prefix)
                flags |= TRANSPORT_PUSH_FORCE;
        if (dry_run)
                flags |= TRANSPORT_PUSH_DRY_RUN;
+       if (verbose)
+               flags |= TRANSPORT_PUSH_VERBOSE;
        if (tags)
                add_refspec("refs/tags/*");
        if (all)