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 <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

brian m. carlson committed May 2, 2018 at 00:26 UTC d8448522d868fc549c69a026a0353c17eb25b897
1 file changed +1 -1
builtin/reset.c
+1 -1
@@ -314,7 +314,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
314 unborn = !strcmp(rev, "HEAD") && get_oid("HEAD", &oid);
315 if (unborn) {
316 /* reset on unborn branch: treat as reset to empty tree */
317 - hashcpy(oid.hash, EMPTY_TREE_SHA1_BIN);
317 + oidcpy(&oid, the_hash_algo->empty_tree);
318 } else if (!pathspec.nr) {
319 struct commit *commit;
320 if (get_oid_committish(rev, &oid))