summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-07-28 17:34:40 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-07-28 17:34:40 (GMT)
commitc97268c822077ba414f90f6ba357fab170bb3986 (patch)
tree344e1158e92b2eb88adcb12589ba174966fd1e43 /t
parent8c6d1f9807c67532e7fb545a944b064faff0f70b (diff)
parentcbcd2cbd5942cc890c1a1125593e1108c3e6a077 (diff)
downloadgit-c97268c822077ba414f90f6ba357fab170bb3986.zip
git-c97268c822077ba414f90f6ba357fab170bb3986.tar.gz
git-c97268c822077ba414f90f6ba357fab170bb3986.tar.bz2
Merge branch 'js/rebase-i-tests'
A few tests that specifically target "git rebase -i" have been added. * js/rebase-i-tests: rebase -i: we allow extra spaces after fixup!/squash! rebase -i: demonstrate a bug with --autosquash t3404: add a test for the --gpg-sign option
Diffstat (limited to 't')
-rwxr-xr-xt/t3404-rebase-interactive.sh8
-rwxr-xr-xt/t3415-rebase-autosquash.sh33
2 files changed, 41 insertions, 0 deletions
diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh
index 3532c48..197914b 100755
--- a/t/t3404-rebase-interactive.sh
+++ b/t/t3404-rebase-interactive.sh
@@ -1281,4 +1281,12 @@ test_expect_success 'editor saves as CR/LF' '
)
'
+SQ="'"
+test_expect_success 'rebase -i --gpg-sign=<key-id>' '
+ set_fake_editor &&
+ FAKE_LINES="edit 1" git rebase -i --gpg-sign="\"S I Gner\"" HEAD^ \
+ >out 2>err &&
+ grep "$SQ-S\"S I Gner\"$SQ" err
+'
+
test_done
diff --git a/t/t3415-rebase-autosquash.sh b/t/t3415-rebase-autosquash.sh
index 8f53e54..48346f1 100755
--- a/t/t3415-rebase-autosquash.sh
+++ b/t/t3415-rebase-autosquash.sh
@@ -271,4 +271,37 @@ test_expect_success 'autosquash with custom inst format' '
test 2 = $(git cat-file commit HEAD^ | grep squash | wc -l)
'
+set_backup_editor () {
+ write_script backup-editor.sh <<-\EOF
+ cp "$1" .git/backup-"$(basename "$1")"
+ EOF
+ test_set_editor "$PWD/backup-editor.sh"
+}
+
+test_expect_failure 'autosquash with multiple empty patches' '
+ test_tick &&
+ git commit --allow-empty -m "empty" &&
+ test_tick &&
+ git commit --allow-empty -m "empty2" &&
+ test_tick &&
+ >fixup &&
+ git add fixup &&
+ git commit --fixup HEAD^^ &&
+ (
+ set_backup_editor &&
+ GIT_USE_REBASE_HELPER=false \
+ git rebase -i --force-rebase --autosquash HEAD~4 &&
+ grep empty2 .git/backup-git-rebase-todo
+ )
+'
+
+test_expect_success 'extra spaces after fixup!' '
+ base=$(git rev-parse HEAD) &&
+ test_commit to-fixup &&
+ git commit --allow-empty -m "fixup! to-fixup" &&
+ git rebase -i --autosquash --keep-empty HEAD~2 &&
+ parent=$(git rev-parse HEAD^) &&
+ test $base = $parent
+'
+
test_done