summaryrefslogtreecommitdiff
path: root/t/t3702-add-edit.sh
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2015-05-13 01:21:58 (GMT)
committerJunio C Hamano <gitster@pobox.com>2015-05-13 03:25:08 (GMT)
commitcb64800d83ace6fecb8701151cfdb6ed0712702c (patch)
tree230d77a33004a6cbf1417f99025cd04546c694e2 /t/t3702-add-edit.sh
parent282616c72d1d08a77ca4fe1186cb708c38408d87 (diff)
downloadgit-cb64800d83ace6fecb8701151cfdb6ed0712702c.zip
git-cb64800d83ace6fecb8701151cfdb6ed0712702c.tar.gz
git-cb64800d83ace6fecb8701151cfdb6ed0712702c.tar.bz2
add: check return value of launch_editor
When running "add -e", if launching the editor fails, we do not notice and continue as if the output is what the user asked for. The likely case is that the editor did not touch the contents at all, and we end up adding everything. Reported-by: Russ Cox <rsc@golang.org> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3702-add-edit.sh')
-rwxr-xr-xt/t3702-add-edit.sh7
1 files changed, 7 insertions, 0 deletions
diff --git a/t/t3702-add-edit.sh b/t/t3702-add-edit.sh
index 4ee47cc..3cb74ca 100755
--- a/t/t3702-add-edit.sh
+++ b/t/t3702-add-edit.sh
@@ -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