diff options
author | Johannes Sixt <j6t@kdbg.org> | 2012-09-18 13:15:26 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2012-09-18 13:27:45 -0700 |
commit | ecfe1ea96fde1fa5756ad04f717fd2960ead988a (patch) | |
tree | 6c020d73cfa030843f10b969fc37224a5600ffc4 /git-rebase--interactive.sh | |
parent | 5805853f228acafe1d45edeef780cd1b00b952aa (diff) | |
download | git-ecfe1ea96fde1fa5756ad04f717fd2960ead988a.tar.gz |
rebase -i: fix misleading error message after 'exec no-such' instruction
When the todo sheet of interactive rebase instructs to run a non-existing
command, the operation stops with the following error:
Execution failed: no-such
You can fix the problem, and then run
git rebase --continue
fatal: 'rebase' appears to be a git command, but we were not
able to execute it. Maybe git-rebase is broken?
The reason is that the shell that attempted to run the command exits with
code 127. rebase--interactive just forwards this code to the caller (the
git wrapper). But our smart run-command infrastructure detects this
special exit code and turns it into ENOENT, which in turn is interpreted
by the git wrapper as if the external command that it just executed did
not exist. This is finally translated to the misleading last two lines in
error message cited above.
Fix it by translating the error code before it is forwarded.
Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-rebase--interactive.sh')
-rw-r--r-- | git-rebase--interactive.sh | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/git-rebase--interactive.sh b/git-rebase--interactive.sh index a09e8423dd..56707d7a27 100644 --- a/git-rebase--interactive.sh +++ b/git-rebase--interactive.sh @@ -544,6 +544,10 @@ do_next () { warn warn " git rebase --continue" warn + if test $status -eq 127 # command not found + then + status=1 + fi exit "$status" elif test "$dirty" = t then |