Skip to content

Commit d41836a

Browse files
bk2204gitster
authored andcommitted
builtin/am: convert uses of EMPTY_TREE_SHA1_BIN to the_hash_algo
Convert several uses of EMPTY_TREE_SHA1_BIN to use the_hash_algo and struct object_id instead. Signed-off-by: brian m. carlson <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent d8a92ce commit d41836a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

builtin/am.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1542,7 +1542,7 @@ static int fall_back_threeway(const struct am_state *state, const char *index_pa
15421542
char *their_tree_name;
15431543

15441544
if (get_oid("HEAD", &our_tree) < 0)
1545-
hashcpy(our_tree.hash, EMPTY_TREE_SHA1_BIN);
1545+
oidcpy(&our_tree, the_hash_algo->empty_tree);
15461546

15471547
if (build_fake_ancestor(state, index_path))
15481548
return error("could not build fake ancestor");
@@ -2042,7 +2042,7 @@ static void am_skip(struct am_state *state)
20422042
am_rerere_clear();
20432043

20442044
if (get_oid("HEAD", &head))
2045-
hashcpy(head.hash, EMPTY_TREE_SHA1_BIN);
2045+
oidcpy(&head, the_hash_algo->empty_tree);
20462046

20472047
if (clean_index(&head, &head))
20482048
die(_("failed to clean index"));
@@ -2105,11 +2105,11 @@ static void am_abort(struct am_state *state)
21052105
curr_branch = resolve_refdup("HEAD", 0, &curr_head, NULL);
21062106
has_curr_head = curr_branch && !is_null_oid(&curr_head);
21072107
if (!has_curr_head)
2108-
hashcpy(curr_head.hash, EMPTY_TREE_SHA1_BIN);
2108+
oidcpy(&curr_head, the_hash_algo->empty_tree);
21092109

21102110
has_orig_head = !get_oid("ORIG_HEAD", &orig_head);
21112111
if (!has_orig_head)
2112-
hashcpy(orig_head.hash, EMPTY_TREE_SHA1_BIN);
2112+
oidcpy(&orig_head, the_hash_algo->empty_tree);
21132113

21142114
clean_index(&curr_head, &orig_head);
21152115

0 commit comments

Comments
 (0)