summaryrefslogtreecommitdiff
path: root/cache.h
diff options
context:
space:
mode:
authorBrandon Williams <bmwill@google.com>2017-05-30 17:30:44 (GMT)
committerJunio C Hamano <gitster@pobox.com>2017-06-02 00:36:06 (GMT)
commit1c41c82bc4878138a4c58e4d5df200de17cb8565 (patch)
tree97762b54e2d19ff683481ab2dc43db585d2023aa /cache.h
parent5ee8a954e0191be2a144afdda6e37ef776730246 (diff)
downloadgit-1c41c82bc4878138a4c58e4d5df200de17cb8565.zip
git-1c41c82bc4878138a4c58e4d5df200de17cb8565.tar.gz
git-1c41c82bc4878138a4c58e4d5df200de17cb8565.tar.bz2
grep: convert to struct object_id
Convert the remaining parts of grep to use struct object_id. Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
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 ae4c45d..50fd2b3 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);