From: brian m. carlson Date: Wed, 2 May 2018 00:26:04 +0000 (+0000) Subject: cache-tree: use is_empty_tree_oid X-Git-Tag: v2.18.0-rc0~17^2~6 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/a0554934364f3c8921abb8f7526301e81c230dac?ds=inline cache-tree: use is_empty_tree_oid When comparing an object ID against that of the empty tree, use the is_empty_tree_oid function to ensure that we abstract over the hash algorithm properly. In addition, this is more readable than a plain oidcmp. Signed-off-by: brian m. carlson Signed-off-by: Junio C Hamano --- diff --git a/cache-tree.c b/cache-tree.c index 8c7e1258a4..25663825b5 100644 --- a/cache-tree.c +++ b/cache-tree.c @@ -385,7 +385,7 @@ static int update_one(struct cache_tree *it, /* * "sub" can be an empty tree if all subentries are i-t-a. */ - if (contains_ita && !oidcmp(oid, &empty_tree_oid)) + if (contains_ita && is_empty_tree_oid(oid)) continue; strbuf_grow(&buffer, entlen + 100);