summaryrefslogtreecommitdiff
path: root/builtin/reset.c
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2018-05-02 00:26:02 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-05-02 04:59:52 (GMT)
commitd8448522d868fc549c69a026a0353c17eb25b897 (patch)
tree946da7514638f61dbdce6e148bd9c0d3db8675c1 /builtin/reset.c
parentc00866a2cc94dd0db3306963fad38b5711e542a2 (diff)
downloadgit-d8448522d868fc549c69a026a0353c17eb25b897.zip
git-d8448522d868fc549c69a026a0353c17eb25b897.tar.gz
git-d8448522d868fc549c69a026a0353c17eb25b897.tar.bz2
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>
Diffstat (limited to 'builtin/reset.c')
-rw-r--r--builtin/reset.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/reset.c b/builtin/reset.c
index 7f1c3f0..a862c70 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))