Merge branch 'js/rebase-exec-command-not-found'
authorJunio C Hamano <gitster@pobox.com>
Sun, 30 Sep 2012 05:28:05 +0000 (22:28 -0700)
committerJunio C Hamano <gitster@pobox.com>
Sun, 30 Sep 2012 05:28:05 +0000 (22:28 -0700)
* js/rebase-exec-command-not-found:
rebase -i: fix misleading error message after 'exec no-such' instruction

git-rebase--interactive.sh
t/t3404-rebase-interactive.sh
index a09e8423ddb1d05c581ef72101c3f5201ce2eeb9..56707d7a279274d4086b3eb3f1d1810f66fa8aed 100644 (file)
@@ -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
index 7304b663c31992de232736a3d9201bb878d2c6f4..7a7176088bc7c7e8a75a70538871a438c0667503 100755 (executable)
@@ -118,6 +118,17 @@ test_expect_success 'rebase -i with the exec command checks tree cleanness' '
        git rebase --continue
 '
 
+test_expect_success 'rebase -i with exec of inexistent command' '
+       git checkout master &&
+       test_when_finished "git rebase --abort" &&
+       (
+       FAKE_LINES="exec_this-command-does-not-exist 1" &&
+       export FAKE_LINES &&
+       test_must_fail git rebase -i HEAD^ >actual 2>&1
+       ) &&
+       ! grep "Maybe git-rebase is broken" actual
+'
+
 test_expect_success 'no changes are a nop' '
        git checkout branch2 &&
        git rebase -i F &&