summaryrefslogtreecommitdiff
path: root/transport.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-08-12 16:47:37 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-08-12 16:47:37 (GMT)
commit0a315befa7cb3132ab2ee6caa7dccb2299b7a348 (patch)
tree21d74d49b997d990b7d5067dbf840490cbaa750a /transport.c
parent57734b4e88c4d61329c74f5f4fb042f7de622966 (diff)
parent1eb47f167d65d1d305b9c196a1bb40eb96117cb1 (diff)
downloadgit-0a315befa7cb3132ab2ee6caa7dccb2299b7a348.zip
git-0a315befa7cb3132ab2ee6caa7dccb2299b7a348.tar.gz
git-0a315befa7cb3132ab2ee6caa7dccb2299b7a348.tar.bz2
Merge branch 'rs/use-strbuf-add-unique-abbrev'
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 c5772a1..cf8de6e 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);