From 5c377d3d593d324346bbaa965cbff8870795b420 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scharfe?= Date: Sat, 12 Aug 2017 10:32:59 +0200 Subject: tree-walk: convert fill_tree_descriptor() to 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 Signed-off-by: Rene Scharfe Reviewed-by: brian m. carlson Signed-off-by: Junio C Hamano --- unpack-trees.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'unpack-trees.c') diff --git a/unpack-trees.c b/unpack-trees.c index 862cfce66..233ec5eb3 100644 --- a/unpack-trees.c +++ b/unpack-trees.c @@ -662,10 +662,10 @@ static int traverse_trees_recursive(int n, unsigned long dirmask, else if (i > 1 && are_same_oid(&names[i], &names[i - 2])) t[i] = t[i - 2]; else { - const unsigned char *sha1 = NULL; + const struct object_id *oid = NULL; if (dirmask & 1) - sha1 = names[i].oid->hash; - buf[nr_buf++] = fill_tree_descriptor(t+i, sha1); + oid = names[i].oid; + buf[nr_buf++] = fill_tree_descriptor(t + i, oid); } } -- cgit v1.2.1