git-merge: honor pre-merge-commit hook
[gitweb.git] / builtin / describe.c
index 02ec56417a197b7e252625561fa462a215499a4d..200154297d5ea8baddda52e39cd4de302595bfcc 100644 (file)
@@ -76,7 +76,7 @@ static int commit_name_neq(const void *unused_cmp_data,
 
 static inline struct commit_name *find_commit_name(const struct object_id *peeled)
 {
-       return hashmap_get_from_hash(&names, sha1hash(peeled->hash), peeled->hash);
+       return hashmap_get_from_hash(&names, oidhash(peeled), peeled);
 }
 
 static int replace_name(struct commit_name *e,
@@ -123,7 +123,7 @@ static void add_to_known_names(const char *path,
                if (!e) {
                        e = xmalloc(sizeof(struct commit_name));
                        oidcpy(&e->peeled, peeled);
-                       hashmap_entry_init(e, sha1hash(peeled->hash));
+                       hashmap_entry_init(e, oidhash(peeled));
                        hashmap_add(&names, e);
                        e->path = NULL;
                }
@@ -630,6 +630,7 @@ int cmd_describe(int argc, const char **argv, const char *prefix)
                        struct argv_array args = ARGV_ARRAY_INIT;
                        int fd, result;
 
+                       setup_work_tree();
                        read_cache();
                        refresh_index(&the_index, REFRESH_QUIET|REFRESH_UNMERGED,
                                      NULL, NULL, NULL);