aboutsummaryrefslogtreecommitdiffstats
path: root/decorate.c
diff options
context:
space:
mode:
Diffstat (limited to 'decorate.c')
-rw-r--r--decorate.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/decorate.c b/decorate.c
index de31331fa4..71e79daa82 100644
--- a/decorate.c
+++ b/decorate.c
@@ -2,13 +2,14 @@
* decorate.c - decorate a git object with some arbitrary
* data.
*/
-#include "cache.h"
+#include "git-compat-util.h"
+#include "hashmap.h"
#include "object.h"
#include "decorate.h"
static unsigned int hash_obj(const struct object *obj, unsigned int n)
{
- return sha1hash(obj->oid.hash) % n;
+ return oidhash(&obj->oid) % n;
}
static void *insert_decoration(struct decoration *n, const struct object *base, void *decoration)
@@ -39,7 +40,7 @@ static void grow_decoration(struct decoration *n)
struct decoration_entry *old_entries = n->entries;
n->size = (old_size + 1000) * 3 / 2;
- n->entries = xcalloc(n->size, sizeof(struct decoration_entry));
+ CALLOC_ARRAY(n->entries, n->size);
n->nr = 0;
for (i = 0; i < old_size; i++) {