1
0
mirror of https://github.com/git/git synced 2024-07-07 19:39:27 +00:00

Merge branch 'jk/no-looking-at-dotgit-outside-repo'

A small code cleanup.

* jk/no-looking-at-dotgit-outside-repo:
  sha1_name: make wraparound of the index into ring-buffer explicit
This commit is contained in:
Junio C Hamano 2016-11-01 12:58:49 -07:00
commit e828d33316

View File

@ -510,7 +510,8 @@ const char *find_unique_abbrev(const unsigned char *sha1, int len)
{
static int bufno;
static char hexbuffer[4][GIT_SHA1_HEXSZ + 1];
char *hex = hexbuffer[3 & ++bufno];
char *hex = hexbuffer[bufno];
bufno = (bufno + 1) % ARRAY_SIZE(hexbuffer);
find_unique_abbrev_r(hex, sha1, len);
return hex;
}