diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-08-10 12:33:20 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-08-10 12:33:20 -0700 |
commit | 1a5f1a3f256a53014e5b832e1281d952ec5f9ef7 (patch) | |
tree | 90cdcd99d55b8970bd127078415b26f76524aa11 /sequencer.c | |
parent | 7a3ea666331cd6cf8d9a7a15aafc33459b8c571c (diff) | |
parent | 6999bc7074c2a8d7605c3ad24bd4e5371a6df71c (diff) | |
download | git-1a5f1a3f256a53014e5b832e1281d952ec5f9ef7.tar.gz |
Merge branch 'js/am-3-merge-recursive-direct'
"git am -3" calls "git merge-recursive" when it needs to fall back
to a three-way merge; this call has been turned into an internal
subroutine call instead of spawning a separate subprocess.
* js/am-3-merge-recursive-direct:
merge-recursive: flush output buffer even when erroring out
merge_trees(): ensure that the callers release output buffer
merge-recursive: offer an option to retain the output in 'obuf'
merge-recursive: write the commit title in one go
merge-recursive: flush output buffer before printing error messages
am -3: use merge_recursive() directly again
merge-recursive: switch to returning errors instead of dying
merge-recursive: handle return values indicating errors
merge-recursive: allow write_tree_from_memory() to error out
merge-recursive: avoid returning a wholesale struct
merge_recursive: abort properly upon errors
prepare the builtins for a libified merge_recursive()
merge-recursive: clarify code in was_tracked()
die(_("BUG")): avoid translating bug messages
die("bug"): report bugs consistently
t5520: verify that `pull --rebase` shows the helpful advice when failing
Diffstat (limited to 'sequencer.c')
-rw-r--r-- | sequencer.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sequencer.c b/sequencer.c index 7b1eb14645..2e9c7d0f03 100644 --- a/sequencer.c +++ b/sequencer.c @@ -293,6 +293,9 @@ static int do_recursive_merge(struct commit *base, struct commit *next, clean = merge_trees(&o, head_tree, next_tree, base_tree, &result); + strbuf_release(&o.obuf); + if (clean < 0) + return clean; if (active_cache_changed && write_locked_index(&the_index, &index_lock, COMMIT_LOCK)) @@ -559,6 +562,8 @@ static int do_pick_commit(struct commit *commit, struct replay_opts *opts) if (!opts->strategy || !strcmp(opts->strategy, "recursive") || opts->action == REPLAY_REVERT) { res = do_recursive_merge(base, next, base_label, next_label, head, &msgbuf, opts); + if (res < 0) + return res; write_message(&msgbuf, git_path_merge_msg()); } else { struct commit_list *common = NULL; |