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>
This commit is contained in:
parent
c00866a2cc
commit
d8448522d8
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user