Code

Merge branch 'js/maint-1.6.6-send-pack-stateless-rpc-deadlock-fix' into js/maint...
[git.git] / builtin-fetch.c
index 8654fa7a2dbe2c1ca76a493a4322447de5219b99..d3b9d8a1338474608b8c7af1df4421d7fa058a81 100644 (file)
@@ -11,6 +11,7 @@
 #include "run-command.h"
 #include "parse-options.h"
 #include "sigchain.h"
+#include "transport.h"
 
 static const char * const builtin_fetch_usage[] = {
        "git fetch [options] [<repository> <refspec>...]",
@@ -205,7 +206,6 @@ static int s_update_ref(const char *action,
        return 0;
 }
 
-#define SUMMARY_WIDTH (2 * DEFAULT_ABBREV + 3)
 #define REFCOL_WIDTH  10
 
 static int update_local_ref(struct ref *ref,
@@ -224,7 +224,7 @@ static int update_local_ref(struct ref *ref,
 
        if (!hashcmp(ref->old_sha1, ref->new_sha1)) {
                if (verbosity > 0)
-                       sprintf(display, "= %-*s %-*s -> %s", SUMMARY_WIDTH,
+                       sprintf(display, "= %-*s %-*s -> %s", TRANSPORT_SUMMARY_WIDTH,
                                "[up to date]", REFCOL_WIDTH, remote,
                                pretty_ref);
                return 0;
@@ -239,7 +239,7 @@ static int update_local_ref(struct ref *ref,
                 * the head, and the old value of the head isn't empty...
                 */
                sprintf(display, "! %-*s %-*s -> %s  (can't fetch in current branch)",
-                       SUMMARY_WIDTH, "[rejected]", REFCOL_WIDTH, remote,
+                       TRANSPORT_SUMMARY_WIDTH, "[rejected]", REFCOL_WIDTH, remote,
                        pretty_ref);
                return 1;
        }
@@ -249,7 +249,7 @@ static int update_local_ref(struct ref *ref,
                int r;
                r = s_update_ref("updating tag", ref, 0);
                sprintf(display, "%c %-*s %-*s -> %s%s", r ? '!' : '-',
-                       SUMMARY_WIDTH, "[tag update]", REFCOL_WIDTH, remote,
+                       TRANSPORT_SUMMARY_WIDTH, "[tag update]", REFCOL_WIDTH, remote,
                        pretty_ref, r ? "  (unable to update local ref)" : "");
                return r;
        }
@@ -271,7 +271,7 @@ static int update_local_ref(struct ref *ref,
 
                r = s_update_ref(msg, ref, 0);
                sprintf(display, "%c %-*s %-*s -> %s%s", r ? '!' : '*',
-                       SUMMARY_WIDTH, what, REFCOL_WIDTH, remote, pretty_ref,
+                       TRANSPORT_SUMMARY_WIDTH, what, REFCOL_WIDTH, remote, pretty_ref,
                        r ? "  (unable to update local ref)" : "");
                return r;
        }
@@ -284,7 +284,7 @@ static int update_local_ref(struct ref *ref,
                strcat(quickref, find_unique_abbrev(ref->new_sha1, DEFAULT_ABBREV));
                r = s_update_ref("fast-forward", ref, 1);
                sprintf(display, "%c %-*s %-*s -> %s%s", r ? '!' : ' ',
-                       SUMMARY_WIDTH, quickref, REFCOL_WIDTH, remote,
+                       TRANSPORT_SUMMARY_WIDTH, quickref, REFCOL_WIDTH, remote,
                        pretty_ref, r ? "  (unable to update local ref)" : "");
                return r;
        } else if (force || ref->force) {
@@ -295,13 +295,13 @@ static int update_local_ref(struct ref *ref,
                strcat(quickref, find_unique_abbrev(ref->new_sha1, DEFAULT_ABBREV));
                r = s_update_ref("forced-update", ref, 1);
                sprintf(display, "%c %-*s %-*s -> %s  (%s)", r ? '!' : '+',
-                       SUMMARY_WIDTH, quickref, REFCOL_WIDTH, remote,
+                       TRANSPORT_SUMMARY_WIDTH, quickref, REFCOL_WIDTH, remote,
                        pretty_ref,
                        r ? "unable to update local ref" : "forced update");
                return r;
        } else {
                sprintf(display, "! %-*s %-*s -> %s  (non-fast-forward)",
-                       SUMMARY_WIDTH, "[rejected]", REFCOL_WIDTH, remote,
+                       TRANSPORT_SUMMARY_WIDTH, "[rejected]", REFCOL_WIDTH, remote,
                        pretty_ref);
                return 1;
        }
@@ -393,7 +393,7 @@ static int store_updated_refs(const char *raw_url, const char *remote_name,
                        rc |= update_local_ref(ref, what, note);
                else
                        sprintf(note, "* %-*s %-*s -> FETCH_HEAD",
-                               SUMMARY_WIDTH, *kind ? kind : "branch",
+                               TRANSPORT_SUMMARY_WIDTH, *kind ? kind : "branch",
                                 REFCOL_WIDTH, *what ? what : "HEAD");
                if (*note) {
                        if (verbosity >= 0 && !shown_url) {
@@ -514,7 +514,7 @@ static int prune_refs(struct transport *transport, struct ref *ref_map)
                        result |= delete_ref(ref->name, NULL, 0);
                if (verbosity >= 0) {
                        fprintf(stderr, " x %-*s %-*s -> %s\n",
-                               SUMMARY_WIDTH, "[deleted]",
+                               TRANSPORT_SUMMARY_WIDTH, "[deleted]",
                                REFCOL_WIDTH, "(none)", prettify_refname(ref->name));
                        warn_dangling_symref(stderr, dangling_msg, ref->name);
                }