Skip to content

Commit

Permalink
Merge branch 'mh/find-uniq-abbrev' into maint
Browse files Browse the repository at this point in the history
* mh/find-uniq-abbrev:
  sha1_name: avoid unnecessary sha1 lookup in find_unique_abbrev
  • Loading branch information
Junio C Hamano committed Jan 12, 2015
2 parents 9ea21fa + 61e704e commit efc028b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sha1_name.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,10 +372,10 @@ const char *find_unique_abbrev(const unsigned char *sha1, int len)
int status, exists;
static char hex[41];

exists = has_sha1_file(sha1);
memcpy(hex, sha1_to_hex(sha1), 40);
if (len == 40 || !len)
return hex;
exists = has_sha1_file(sha1);
while (len < 40) {
unsigned char sha1_ret[20];
status = get_short_sha1(hex, len, sha1_ret, GET_SHA1_QUIETLY);
Expand Down

0 comments on commit efc028b

Please sign in to comment.