1
0
mirror of https://github.com/git/git synced 2024-07-02 15:48:44 +00:00

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 <sandals@crustytoothpaste.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
brian m. carlson 2018-05-02 00:26:04 +00:00 committed by Junio C Hamano
parent 62ba93eaa9
commit a055493436

View 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.
*/
if (contains_ita && !oidcmp(oid, &empty_tree_oid))
if (contains_ita && is_empty_tree_oid(oid))
continue;
strbuf_grow(&buffer, entlen + 100);