diff options
author | Fabian Ruch <bafain@gmail.com> | 2014-06-09 17:04:36 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-06-09 14:55:43 -0700 |
commit | 43dee070eb8faa400f24a9fee08e64d2d18224c2 (patch) | |
tree | 5e038c70bbfe50637a3add5420d61377c9055db3 /sequencer.c | |
parent | bce14aa132e0064d9a9b1c7ad98e71e22c6e0272 (diff) | |
download | git-43dee070eb8faa400f24a9fee08e64d2d18224c2.tar.gz |
sequencer: signal failed ff as an aborted, not a conflicted mergefr/sequencer-fail-with-not-one-upon-no-ff
`do_pick_commit` handles three situations if it is not fast-forwarding.
In order for `do_pick_commit` to identify the situation, it examines the
return value of the selected merge command.
1. return value 0 stands for a clean merge
2. 1 is passed in case of a failed merge due to conflict
3. any other return value means that the merge did not even start
So far, the sequencer returns 1 in case of a failed fast-forward, which
would mean "failed merge due to conflict". However, a fast-forward
either starts and succeeds or does not start at all. In particular, it
cannot fail in between like a merge with a dirty index due to conflicts.
In order to signal the three possible situations (not only success and
failure to complete) after a pick through porcelain commands such as
`cherry-pick`, exit with a return value that is neither 0 nor 1. 128 was
chosen in line with the other situations in which the sequencer
encounters an error. In such situations, the sequencer returns a
negative value and `cherry-pick` translates this into a call to `die`.
`die` then terminates the process with exit status 128.
Signed-off-by: Fabian Ruch <bafain@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'sequencer.c')
-rw-r--r-- | sequencer.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sequencer.c b/sequencer.c index bde5f047b0..b087e121b4 100644 --- a/sequencer.c +++ b/sequencer.c @@ -278,7 +278,7 @@ static int fast_forward_to(const unsigned char *to, const unsigned char *from, read_cache(); if (checkout_fast_forward(from, to, 1)) - exit(1); /* the callee should have complained already */ + exit(128); /* the callee should have complained already */ ref_lock = lock_any_ref_for_update("HEAD", unborn ? null_sha1 : from, 0, NULL); strbuf_addf(&sb, "%s: fast-forward", action_name(opts)); |