From: brian m. carlson Date: Wed, 2 May 2018 00:26:02 +0000 (+0000) Subject: builtin/reset: convert use of EMPTY_TREE_SHA1_BIN X-Git-Tag: v2.18.0-rc0~17^2~8 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/d8448522d868fc549c69a026a0353c17eb25b897?hp=--cc builtin/reset: convert use of EMPTY_TREE_SHA1_BIN Convert the last use of EMPTY_TREE_SHA1_BIN to use a direct copy from the_hash_algo->empty_tree to avoid a dependency on a given hash algorithm. Signed-off-by: brian m. carlson Signed-off-by: Junio C Hamano --- d8448522d868fc549c69a026a0353c17eb25b897 diff --git a/builtin/reset.c b/builtin/reset.c index 7f1c3f02a3..a862c70fab 100644 --- a/builtin/reset.c +++ b/builtin/reset.c @@ -314,7 +314,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix) unborn = !strcmp(rev, "HEAD") && get_oid("HEAD", &oid); if (unborn) { /* reset on unborn branch: treat as reset to empty tree */ - hashcpy(oid.hash, EMPTY_TREE_SHA1_BIN); + oidcpy(&oid, the_hash_algo->empty_tree); } else if (!pathspec.nr) { struct commit *commit; if (get_oid_committish(rev, &oid))