refs: convert update_ref and refs_update_ref to use struct object_id
Convert update_ref, refs_update_ref, and write_pseudoref to use struct object_id. Update the existing callers as well. Remove update_ref_oid, as it is no longer needed. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
2616a5e508
commit
ae077771b0
14
builtin/am.c
14
builtin/am.c
@ -1068,8 +1068,8 @@ static void am_setup(struct am_state *state, enum patch_format patch_format,
|
||||
if (!get_oid("HEAD", &curr_head)) {
|
||||
write_state_text(state, "abort-safety", oid_to_hex(&curr_head));
|
||||
if (!state->rebasing)
|
||||
update_ref_oid("am", "ORIG_HEAD", &curr_head, NULL, 0,
|
||||
UPDATE_REFS_DIE_ON_ERR);
|
||||
update_ref("am", "ORIG_HEAD", &curr_head, NULL, 0,
|
||||
UPDATE_REFS_DIE_ON_ERR);
|
||||
} else {
|
||||
write_state_text(state, "abort-safety", "");
|
||||
if (!state->rebasing)
|
||||
@ -1686,8 +1686,8 @@ static void do_commit(const struct am_state *state)
|
||||
strbuf_addf(&sb, "%s: %.*s", reflog_msg, linelen(state->msg),
|
||||
state->msg);
|
||||
|
||||
update_ref_oid(sb.buf, "HEAD", &commit, old_oid, 0,
|
||||
UPDATE_REFS_DIE_ON_ERR);
|
||||
update_ref(sb.buf, "HEAD", &commit, old_oid, 0,
|
||||
UPDATE_REFS_DIE_ON_ERR);
|
||||
|
||||
if (state->rebasing) {
|
||||
FILE *fp = xfopen(am_path(state, "rewritten"), "a");
|
||||
@ -2147,9 +2147,9 @@ static void am_abort(struct am_state *state)
|
||||
clean_index(&curr_head, &orig_head);
|
||||
|
||||
if (has_orig_head)
|
||||
update_ref_oid("am --abort", "HEAD", &orig_head,
|
||||
has_curr_head ? &curr_head : NULL, 0,
|
||||
UPDATE_REFS_DIE_ON_ERR);
|
||||
update_ref("am --abort", "HEAD", &orig_head,
|
||||
has_curr_head ? &curr_head : NULL, 0,
|
||||
UPDATE_REFS_DIE_ON_ERR);
|
||||
else if (curr_branch)
|
||||
delete_ref(NULL, curr_branch, NULL, REF_NODEREF);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user