summaryrefslogtreecommitdiff
path: root/t/t3436-rebase-more-options.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t3436-rebase-more-options.sh')
-rwxr-xr-xt/t3436-rebase-more-options.sh35
1 files changed, 32 insertions, 3 deletions
diff --git a/t/t3436-rebase-more-options.sh b/t/t3436-rebase-more-options.sh
index 996e827..94671d3 100755
--- a/t/t3436-rebase-more-options.sh
+++ b/t/t3436-rebase-more-options.sh
@@ -28,7 +28,7 @@ test_expect_success 'setup' '
test_commit commit2 foo foo2 &&
test_commit commit3 foo foo3 &&
- git checkout --orphan master &&
+ git checkout --orphan main &&
rm foo &&
test_write_lines "line 1" " line 2" "line 3" >file &&
git commit -am "add file" &&
@@ -65,8 +65,8 @@ test_expect_success '--ignore-whitespace is remembered when continuing' '
'
test_ctime_is_atime () {
- git log $1 --format=%ai >authortime &&
- git log $1 --format=%ci >committertime &&
+ git log $1 --format="$GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> %ai" >authortime &&
+ git log $1 --format="%cn <%ce> %ci" >committertime &&
test_cmp authortime committertime
}
@@ -82,6 +82,20 @@ test_expect_success '--committer-date-is-author-date works with merge backend' '
test_ctime_is_atime -1
'
+test_expect_success '--committer-date-is-author-date works when rewording' '
+ GIT_AUTHOR_DATE="@1234 +0300" git commit --amend --reset-author &&
+ (
+ set_fake_editor &&
+ FAKE_COMMIT_MESSAGE=edited \
+ FAKE_LINES="reword 1" \
+ git rebase -i --committer-date-is-author-date HEAD^
+ ) &&
+ test_write_lines edited "" >expect &&
+ git log --format="%B" -1 >actual &&
+ test_cmp expect actual &&
+ test_ctime_is_atime -1
+'
+
test_expect_success '--committer-date-is-author-date works with rebase -r' '
git checkout side &&
GIT_AUTHOR_DATE="@1234 +0300" git merge --no-ff commit3 &&
@@ -155,6 +169,21 @@ test_expect_success '--reset-author-date with --committer-date-is-author-date wo
test_atime_is_ignored -2
'
+test_expect_success 'reset-author-date with --committer-date-is-author-date works when rewording' '
+ GIT_AUTHOR_DATE="@1234 +0300" git commit --amend --reset-author &&
+ (
+ set_fake_editor &&
+ FAKE_COMMIT_MESSAGE=edited \
+ FAKE_LINES="reword 1" \
+ git rebase -i --committer-date-is-author-date \
+ --reset-author-date HEAD^
+ ) &&
+ test_write_lines edited "" >expect &&
+ git log --format="%B" -1 >actual &&
+ test_cmp expect actual &&
+ test_atime_is_ignored -1
+'
+
test_expect_success '--reset-author-date --committer-date-is-author-date works when forking merge' '
GIT_SEQUENCE_EDITOR="echo \"merge -C $(git rev-parse HEAD) commit3\">" \
PATH="./test-bin:$PATH" git rebase -i --strategy=test \