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

brian m. carlson committed May 2, 2018 at 00:25 UTC d41836a0b2599d1faa93c60dc67c920045ee1f57
1 file changed +4 -4
builtin/am.c
+4 -4
@@ -1542,7 +1542,7 @@ static int fall_back_threeway(const struct am_state *state, const char *index_pa
1542 char *their_tree_name;
1543
1544 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);
1546
1547 if (build_fake_ancestor(state, index_path))
1548 return error("could not build fake ancestor");
@@ -2042,7 +2042,7 @@ static void am_skip(struct am_state *state)
2042 am_rerere_clear();
2043
2044 if (get_oid("HEAD", &head))
2045 - hashcpy(head.hash, EMPTY_TREE_SHA1_BIN);
2045 + oidcpy(&head, the_hash_algo->empty_tree);
2046
2047 if (clean_index(&head, &head))
2048 die(_("failed to clean index"));
@@ -2105,11 +2105,11 @@ static void am_abort(struct am_state *state)
2105 curr_branch = resolve_refdup("HEAD", 0, &curr_head, NULL);
2106 has_curr_head = curr_branch && !is_null_oid(&curr_head);
2107 if (!has_curr_head)
2108 - hashcpy(curr_head.hash, EMPTY_TREE_SHA1_BIN);
2108 + oidcpy(&curr_head, the_hash_algo->empty_tree);
2109
2110 has_orig_head = !get_oid("ORIG_HEAD", &orig_head);
2111 if (!has_orig_head)
2112 - hashcpy(orig_head.hash, EMPTY_TREE_SHA1_BIN);
2112 + oidcpy(&orig_head, the_hash_algo->empty_tree);
2113
2114 clean_index(&curr_head, &orig_head);
2115