diff options
author | Junio C Hamano <gitster@pobox.com> | 2009-10-19 00:49:21 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-10-19 00:49:21 -0700 |
commit | e79999b1a285d4dcf1d84bc893c864516a390cfa (patch) | |
tree | cebc2524c6c0421e4590b2200802d3f64734075c /t | |
parent | 7f98ebc8fd34107c6234cbad7b776054810b6fe1 (diff) | |
parent | 7725cb5e8bfd27887ee0b984b83708eff655ec9e (diff) | |
download | git-e79999b1a285d4dcf1d84bc893c864516a390cfa.tar.gz git-e79999b1a285d4dcf1d84bc893c864516a390cfa.tar.xz |
Merge branch 'bg/rebase-reword'
* bg/rebase-reword:
rebase -i: fix reword when using a terminal editor
Teach 'rebase -i' the command "reword"
Diffstat (limited to 't')
-rw-r--r-- | t/lib-rebase.sh | 6 | ||||
-rwxr-xr-x | t/t3404-rebase-interactive.sh | 14 |
2 files changed, 17 insertions, 3 deletions
diff --git a/t/lib-rebase.sh b/t/lib-rebase.sh index 260a23193..62f452c8e 100644 --- a/t/lib-rebase.sh +++ b/t/lib-rebase.sh @@ -9,8 +9,8 @@ # # "[<lineno1>] [<lineno2>]..." # -# If a line number is prefixed with "squash" or "edit", the respective line's -# command will be replaced with the specified one. +# If a line number is prefixed with "squash", "edit", or "reword", the +# respective line's command will be replaced with the specified one. set_fake_editor () { echo "#!$SHELL_PATH" >fake-editor.sh @@ -32,7 +32,7 @@ cat "$1".tmp action=pick for line in $FAKE_LINES; do case $line in - squash|edit) + squash|edit|reword) action="$line";; *) echo sed -n "${line}s/^pick/$action/p" diff --git a/t/t3404-rebase-interactive.sh b/t/t3404-rebase-interactive.sh index 4cae01952..3a37793c0 100755 --- a/t/t3404-rebase-interactive.sh +++ b/t/t3404-rebase-interactive.sh @@ -470,4 +470,18 @@ test_expect_success 'avoid unnecessary reset' ' test 123456789 = $MTIME ' +test_expect_success 'reword' ' + git checkout -b reword-branch master && + FAKE_LINES="1 2 3 reword 4" FAKE_COMMIT_MESSAGE="E changed" git rebase -i A && + git show HEAD | grep "E changed" && + test $(git rev-parse master) != $(git rev-parse HEAD) && + test $(git rev-parse master^) = $(git rev-parse HEAD^) && + FAKE_LINES="1 2 reword 3 4" FAKE_COMMIT_MESSAGE="D changed" git rebase -i A && + git show HEAD^ | grep "D changed" && + FAKE_LINES="reword 1 2 3 4" FAKE_COMMIT_MESSAGE="B changed" git rebase -i A && + git show HEAD~3 | grep "B changed" && + FAKE_LINES="1 reword 2 3 4" FAKE_COMMIT_MESSAGE="C changed" git rebase -i A && + git show HEAD~2 | grep "C changed" +' + test_done |