dir: use the_hash_algo for empty blob object ID

To ensure that we are hash algorithm agnostic, use the_hash_algo to look
up the object ID for the empty blob instead of using the empty_tree_oid
variable.

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:06 +00:00 committed by Junio C Hamano
parent 57911a31fe
commit ba2df7519a

2
dir.c
View File

@ -828,7 +828,7 @@ static int add_excludes(const char *fname, const char *base, int baselen,
if (size == 0) {
if (oid_stat) {
fill_stat_data(&oid_stat->stat, &st);
oidcpy(&oid_stat->oid, &empty_blob_oid);
oidcpy(&oid_stat->oid, the_hash_algo->empty_blob);
oid_stat->valid = 1;
}
close(fd);