mirror of
https://github.com/git/git
synced 2024-08-25 02:35:46 +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:
commit
e828d33316
|
@ -510,7 +510,8 @@ const char *find_unique_abbrev(const unsigned char *sha1, int len)
|
||||||
{
|
{
|
||||||
static int bufno;
|
static int bufno;
|
||||||
static char hexbuffer[4][GIT_SHA1_HEXSZ + 1];
|
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);
|
find_unique_abbrev_r(hex, sha1, len);
|
||||||
return hex;
|
return hex;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue