aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-02-05 14:54:20 -0800
committerJunio C Hamano <gitster@pobox.com>2016-02-05 14:54:21 -0800
commit0298675ac41520aa825ff347086f449a4d2af22e (patch)
tree245b3f208dbcd718db1e94d3a32ad56a48d96402 /t
parent01517bd26ff6ad179c0ea60161193aa4bac1bcb7 (diff)
parent36fc7d8a7979b4e75d36b4eab77782beb7d93533 (diff)
downloadgit-0298675ac41520aa825ff347086f449a4d2af22e.tar.gz
git-0298675ac41520aa825ff347086f449a4d2af22e.tar.xz
Merge branch 'sg/t6050-failing-editor-test-fix' into maint
* sg/t6050-failing-editor-test-fix: t6050-replace: make failing editor test more robust
Diffstat (limited to 't')
-rwxr-xr-xt/t6050-replace.sh10
1 files changed, 7 insertions, 3 deletions
diff --git a/t/t6050-replace.sh b/t/t6050-replace.sh
index 4d5a25eed..c630aba65 100755
--- a/t/t6050-replace.sh
+++ b/t/t6050-replace.sh
@@ -351,11 +351,15 @@ test_expect_success 'test --format long' '
test_cmp expected actual
'
-test_expect_success 'setup a fake editor' '
- write_script fakeeditor <<-\EOF
+test_expect_success 'setup fake editors' '
+ write_script fakeeditor <<-\EOF &&
sed -e "s/A U Thor/A fake Thor/" "$1" >"$1.new"
mv "$1.new" "$1"
EOF
+ write_script failingfakeeditor <<-\EOF
+ ./fakeeditor "$@"
+ false
+ EOF
'
test_expect_success '--edit with and without already replaced object' '
@@ -372,7 +376,7 @@ test_expect_success '--edit with and without already replaced object' '
test_expect_success '--edit and change nothing or command failed' '
git replace -d "$PARA3" &&
test_must_fail env GIT_EDITOR=true git replace --edit "$PARA3" &&
- test_must_fail env GIT_EDITOR="./fakeeditor;false" git replace --edit "$PARA3" &&
+ test_must_fail env GIT_EDITOR="./failingfakeeditor" git replace --edit "$PARA3" &&
GIT_EDITOR=./fakeeditor git replace --edit "$PARA3" &&
git replace -l | grep "$PARA3" &&
git cat-file commit "$PARA3" | grep "A fake Thor"