Skip to content

Commit d844852

Browse files
bk2204gitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c00866a commit d844852

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin/reset.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ int cmd_reset(int argc, const char **argv, const char *prefix)
314314
unborn = !strcmp(rev, "HEAD") && get_oid("HEAD", &oid);
315315
if (unborn) {
316316
/* 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);
318318
} else if (!pathspec.nr) {
319319
struct commit *commit;
320320
if (get_oid_committish(rev, &oid))

0 commit comments

Comments
 (0)