summaryrefslogtreecommitdiff
path: root/transport.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-09-09 04:35:59 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-09-09 04:36:00 (GMT)
commit5e469ab66c86d5178aae71cacf9f55c3b378de03 (patch)
tree3329cf6ec9eececfc8f60082f2859f30b25f8c20 /transport.c
parentf14883b972f3d6b104c4d141fc3de34af9ba0b24 (diff)
parent1eb47f167d65d1d305b9c196a1bb40eb96117cb1 (diff)
downloadgit-5e469ab66c86d5178aae71cacf9f55c3b378de03.zip
git-5e469ab66c86d5178aae71cacf9f55c3b378de03.tar.gz
git-5e469ab66c86d5178aae71cacf9f55c3b378de03.tar.bz2
Merge branch 'rs/use-strbuf-add-unique-abbrev' into maint
A small code clean-up. * rs/use-strbuf-add-unique-abbrev: use strbuf_add_unique_abbrev() for adding short hashes
Diffstat (limited to 'transport.c')
-rw-r--r--transport.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/transport.c b/transport.c
index be4a63e..41eb82c 100644
--- a/transport.c
+++ b/transport.c
@@ -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);