diff options
author | brian m. carlson <sandals@crustytoothpaste.net> | 2018-05-02 02:25:29 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-05-02 06:59:48 +0200 |
commit | 69d124255ede771ff8162652762406c55ba491c0 (patch) | |
tree | 3249ee68c31622d295b8086a435acffe8441d045 /cache-tree.c | |
parent | Merge branch 'svn/authors-prog-2' of git://bogomips.org/git-svn (diff) | |
download | git-69d124255ede771ff8162652762406c55ba491c0.tar.xz git-69d124255ede771ff8162652762406c55ba491c0.zip |
cache: add a function to read an object ID from a buffer
In various places throughout the codebase, we need to read data into a
struct object_id from a pack or other unsigned char buffer. Add an
inline function that does this based on the current hash algorithm in
use, and use it in several places.
Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache-tree.c')
-rw-r--r-- | cache-tree.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/cache-tree.c b/cache-tree.c index 6a555f4d43..8c7e1258a4 100644 --- a/cache-tree.c +++ b/cache-tree.c @@ -523,7 +523,7 @@ static struct cache_tree *read_one(const char **buffer, unsigned long *size_p) if (0 <= it->entry_count) { if (size < rawsz) goto free_return; - memcpy(it->oid.hash, (const unsigned char*)buf, rawsz); + oidread(&it->oid, (const unsigned char *)buf); buf += rawsz; size -= rawsz; } |