cache-tree: use is_empty_tree_oid
authorbrian m. carlson <sandals@crustytoothpaste.net>
Wed, 2 May 2018 00:26:04 +0000 (00:26 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 2 May 2018 04:59:52 +0000 (13:59 +0900)
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 <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
cache-tree.c
index 8c7e1258a4861a7f692de6892c18c9a9e1e81061..25663825b553b4e4590e3b4aaad54b4f5950aef8 100644 (file)
@@ -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.
                 */
                /*
                 * "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);
                        continue;
 
                strbuf_grow(&buffer, entlen + 100);