summaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
Diffstat (limited to 'cache.h')
-rw-r--r--cache.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/cache.h b/cache.h
index 4d92aae..d6ba8a2 100644
--- a/cache.h
+++ b/cache.h
@@ -1026,6 +1026,13 @@ static inline void oidcpy(struct object_id *dst, const struct object_id *src)
hashcpy(dst->hash, src->hash);
}
+static inline struct object_id *oiddup(const struct object_id *src)
+{
+ struct object_id *dst = xmalloc(sizeof(struct object_id));
+ oidcpy(dst, src);
+ return dst;
+}
+
static inline void hashclr(unsigned char *hash)
{
memset(hash, 0, GIT_SHA1_RAWSZ);