mirror of
https://github.com/git/git
synced 2024-08-25 02:35:46 +00:00
Merge branch 'jk/add-e-kill-editor' into maint
"git add -e" did not allow the user to abort the operation by killing the editor. * jk/add-e-kill-editor: add: check return value of launch_editor
This commit is contained in:
commit
8d5ef5a0d1
|
@ -208,7 +208,8 @@ static int edit_patch(int argc, const char **argv, const char *prefix)
|
|||
if (run_diff_files(&rev, 0))
|
||||
die(_("Could not write patch"));
|
||||
|
||||
launch_editor(file, NULL, NULL);
|
||||
if (launch_editor(file, NULL, NULL))
|
||||
die(_("editing patch failed"));
|
||||
|
||||
if (stat(file, &st))
|
||||
die_errno(_("Could not stat '%s'"), file);
|
||||
|
|
|
@ -118,4 +118,11 @@ test_expect_success 'add -e' '
|
|||
|
||||
'
|
||||
|
||||
test_expect_success 'add -e notices editor failure' '
|
||||
git reset --hard &&
|
||||
echo change >>file &&
|
||||
test_must_fail env GIT_EDITOR=false git add -e &&
|
||||
test_expect_code 1 git diff --exit-code
|
||||
'
|
||||
|
||||
test_done
|
||||
|
|
Loading…
Reference in a new issue