summaryrefslogtreecommitdiff
path: root/sequencer.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-08-10 19:33:20 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-08-10 19:33:20 (GMT)
commit1a5f1a3f256a53014e5b832e1281d952ec5f9ef7 (patch)
tree90cdcd99d55b8970bd127078415b26f76524aa11 /sequencer.c
parent7a3ea666331cd6cf8d9a7a15aafc33459b8c571c (diff)
parent6999bc7074c2a8d7605c3ad24bd4e5371a6df71c (diff)
downloadgit-1a5f1a3f256a53014e5b832e1281d952ec5f9ef7.zip
git-1a5f1a3f256a53014e5b832e1281d952ec5f9ef7.tar.gz
git-1a5f1a3f256a53014e5b832e1281d952ec5f9ef7.tar.bz2
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.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/sequencer.c b/sequencer.c
index 7b1eb14..2e9c7d0 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;