pkt-line: add functions to read/write flush terminated packet streams
[gitweb.git] / transport.c
index c5772a14eeec3d5651796c8051443dd76583c05d..94d6dc3725a2bb091df66ce6fe266ddd5317ed02 100644 (file)
@@ -321,11 +321,6 @@ static void print_ref_status(char flag, const char *summary, struct ref *to, str
        }
 }
 
-static const char *status_abbrev(unsigned char sha1[20])
-{
-       return find_unique_abbrev(sha1, DEFAULT_ABBREV);
-}
-
 static void print_ok_ref_status(struct ref *ref, int porcelain)
 {
        if (ref->deletion)
@@ -340,7 +335,8 @@ static void print_ok_ref_status(struct ref *ref, int porcelain)
                char type;
                const char *msg;
 
-               strbuf_addstr(&quickref, status_abbrev(ref->old_oid.hash));
+               strbuf_add_unique_abbrev(&quickref, ref->old_oid.hash,
+                                        DEFAULT_ABBREV);
                if (ref->forced_update) {
                        strbuf_addstr(&quickref, "...");
                        type = '+';
@@ -350,7 +346,8 @@ static void print_ok_ref_status(struct ref *ref, int porcelain)
                        type = ' ';
                        msg = NULL;
                }
-               strbuf_addstr(&quickref, status_abbrev(ref->new_oid.hash));
+               strbuf_add_unique_abbrev(&quickref, ref->new_oid.hash,
+                                        DEFAULT_ABBREV);
 
                print_ref_status(type, quickref.buf, ref, ref->peer_ref, msg, porcelain);
                strbuf_release(&quickref);
@@ -774,7 +771,7 @@ static void die_with_unpushed_submodules(struct string_list *needs_pushing)
        fprintf(stderr, _("The following submodule paths contain changes that can\n"
                        "not be found on any remote:\n"));
        for (i = 0; i < needs_pushing->nr; i++)
-               printf("  %s\n", needs_pushing->items[i].string);
+               fprintf(stderr, "  %s\n", needs_pushing->items[i].string);
        fprintf(stderr, _("\nPlease try\n\n"
                          "     git push --recurse-submodules=on-demand\n\n"
                          "or cd to the path and use\n\n"