diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-08-12 09:47:37 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-08-12 09:47:37 -0700 |
commit | 0a315befa7cb3132ab2ee6caa7dccb2299b7a348 (patch) | |
tree | 21d74d49b997d990b7d5067dbf840490cbaa750a /transport.c | |
parent | 57734b4e88c4d61329c74f5f4fb042f7de622966 (diff) | |
parent | 1eb47f167d65d1d305b9c196a1bb40eb96117cb1 (diff) | |
download | git-0a315befa7cb3132ab2ee6caa7dccb2299b7a348.tar.gz |
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.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/transport.c b/transport.c index c5772a14ee..cf8de6e888 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); |