sequencer: release strbuf after use in save_head()
[gitweb.git] / sha1_name.c
index 7577eaecfa382036c0ac0c1593a2f63388854564..134ac9742f9eed3dc6e587875bdb9aa77b7a8307 100644 (file)
@@ -9,6 +9,7 @@
 #include "remote.h"
 #include "dir.h"
 #include "sha1-array.h"
+#include "packfile.h"
 
 static int get_oid_oneline(const char *, struct object_id *, struct commit_list *);
 
@@ -500,10 +501,10 @@ int find_unique_abbrev_r(char *hex, const unsigned char *sha1, int len)
        }
 
        sha1_to_hex_r(hex, sha1);
-       if (len == 40 || !len)
-               return 40;
+       if (len == GIT_SHA1_HEXSZ || !len)
+               return GIT_SHA1_HEXSZ;
        exists = has_sha1_file(sha1);
-       while (len < 40) {
+       while (len < GIT_SHA1_HEXSZ) {
                struct object_id oid_ret;
                status = get_short_oid(hex, len, &oid_ret, GET_OID_QUIETLY);
                if (exists