test-lib.sh: do tests for color support after changing HOME
[gitweb.git] / builtin / describe.c
index 57e84c8ae68c8172b3cbc4136f40c459743427da..9103193b4f65dc9e224051fb1e19eda6d9c7ae6a 100644 (file)
@@ -1,4 +1,5 @@
 #include "cache.h"
+#include "lockfile.h"
 #include "commit.h"
 #include "tag.h"
 #include "refs.h"
@@ -58,9 +59,7 @@ static int commit_name_cmp(const struct commit_name *cn1,
 
 static inline struct commit_name *find_commit_name(const unsigned char *peeled)
 {
-       struct commit_name key;
-       hashmap_entry_init(&key, sha1hash(peeled));
-       return hashmap_get(&names, &key, peeled);
+       return hashmap_get_from_hash(&names, sha1hash(peeled), peeled);
 }
 
 static int replace_name(struct commit_name *e,