First batch for 2.12
[gitweb.git] / sha1_name.c
index c71fc172f55dcfed6cda15220151231557f4e5a6..73a915ff1b3278f08ef4f327a55fe61d238f720a 100644 (file)
@@ -508,7 +508,10 @@ int find_unique_abbrev_r(char *hex, const unsigned char *sha1, int len)
 
 const char *find_unique_abbrev(const unsigned char *sha1, int len)
 {
-       static char hex[GIT_SHA1_HEXSZ + 1];
+       static int bufno;
+       static char hexbuffer[4][GIT_SHA1_HEXSZ + 1];
+       char *hex = hexbuffer[bufno];
+       bufno = (bufno + 1) % ARRAY_SIZE(hexbuffer);
        find_unique_abbrev_r(hex, sha1, len);
        return hex;
 }