From fc5cb99f675b2052f6d6bd3e2520379031b12267 Mon Sep 17 00:00:00 2001 From: "brian m. carlson" Date: Mon, 12 Mar 2018 02:27:23 +0000 Subject: cache-tree: convert write_*_as_tree to object_id Convert write_index_as_tree and write_cache_as_tree to use struct object_id. Signed-off-by: brian m. carlson Signed-off-by: Junio C Hamano --- cache-tree.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'cache-tree.c') diff --git a/cache-tree.c b/cache-tree.c index c52e4303df..ba07a8067e 100644 --- a/cache-tree.c +++ b/cache-tree.c @@ -599,7 +599,7 @@ static struct cache_tree *cache_tree_find(struct cache_tree *it, const char *pat return it; } -int write_index_as_tree(unsigned char *sha1, struct index_state *index_state, const char *index_path, int flags, const char *prefix) +int write_index_as_tree(struct object_id *oid, struct index_state *index_state, const char *index_path, int flags, const char *prefix) { int entries, was_valid; struct lock_file lock_file = LOCK_INIT; @@ -640,19 +640,19 @@ int write_index_as_tree(unsigned char *sha1, struct index_state *index_state, co ret = WRITE_TREE_PREFIX_ERROR; goto out; } - hashcpy(sha1, subtree->oid.hash); + oidcpy(oid, &subtree->oid); } else - hashcpy(sha1, index_state->cache_tree->oid.hash); + oidcpy(oid, &index_state->cache_tree->oid); out: rollback_lock_file(&lock_file); return ret; } -int write_cache_as_tree(unsigned char *sha1, int flags, const char *prefix) +int write_cache_as_tree(struct object_id *oid, int flags, const char *prefix) { - return write_index_as_tree(sha1, &the_index, get_index_file(), flags, prefix); + return write_index_as_tree(oid, &the_index, get_index_file(), flags, prefix); } static void prime_cache_tree_rec(struct cache_tree *it, struct tree *tree) -- cgit v1.2.3