summaryrefslogtreecommitdiff
path: root/tree-walk.c
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2017-08-12 10:32:59 +0200
committerJunio C Hamano <gitster@pobox.com>2017-08-14 12:38:54 -0700
commit5c377d3d593d324346bbaa965cbff8870795b420 (patch)
treeb2a517d5ec88c9b5c2618b80b0f45a74fdaf2638 /tree-walk.c
parentb3622a4ee94e4916cd05e6d96e41eeb36b941182 (diff)
downloadgit-5c377d3d593d324346bbaa965cbff8870795b420.tar.gz
tree-walk: convert fill_tree_descriptor() to object_idrs/object-id
All callers of fill_tree_descriptor() have been converted to object_id already, so convert that function as well. As a nice side-effect we get rid of NULL checks in tree-diff.c, as fill_tree_descriptor() already does them for us. Helped-by: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Rene Scharfe <l.s.r@web.de> Reviewed-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'tree-walk.c')
-rw-r--r--tree-walk.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/tree-walk.c b/tree-walk.c
index 6a42e402b0..c99309069a 100644
--- a/tree-walk.c
+++ b/tree-walk.c
@@ -78,15 +78,16 @@ int init_tree_desc_gently(struct tree_desc *desc, const void *buffer, unsigned l
return result;
}
-void *fill_tree_descriptor(struct tree_desc *desc, const unsigned char *sha1)
+void *fill_tree_descriptor(struct tree_desc *desc, const struct object_id *oid)
{
unsigned long size = 0;
void *buf = NULL;
- if (sha1) {
- buf = read_object_with_reference(sha1, tree_type, &size, NULL);
+ if (oid) {
+ buf = read_object_with_reference(oid->hash, tree_type, &size,
+ NULL);
if (!buf)
- die("unable to read tree %s", sha1_to_hex(sha1));
+ die("unable to read tree %s", oid_to_hex(oid));
}
init_tree_desc(desc, buf, size);
return buf;