diff options
author | Rohit Ashiwal <rohit.ashiwal265@gmail.com> | 2020-08-17 18:40:04 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-08-19 15:22:56 -0700 |
commit | 27126692ba1688081d8427220087bb7662594bd9 (patch) | |
tree | 2b01a2bcfc418c75abe7d34e00ebf6f6e1424be6 /t | |
parent | rebase -i: support --ignore-date (diff) | |
download | tgif-27126692ba1688081d8427220087bb7662594bd9.tar.xz |
rebase: add --reset-author-date
The previous commit introduced --ignore-date flag to rebase -i, but the
name is rather vague as it does not say whether the author date or the
committer date is ignored. Add an alias to convey the precise purpose.
Helped-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Rohit Ashiwal <rohit.ashiwal265@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-x | t/t3436-rebase-more-options.sh | 34 |
1 files changed, 21 insertions, 13 deletions
diff --git a/t/t3436-rebase-more-options.sh b/t/t3436-rebase-more-options.sh index 8d73639954..627fa163a2 100755 --- a/t/t3436-rebase-more-options.sh +++ b/t/t3436-rebase-more-options.sh @@ -117,20 +117,20 @@ test_atime_is_ignored () { ! grep -v +0000 authortime } -test_expect_success '--ignore-date works with apply backend' ' +test_expect_success '--reset-author-date works with apply backend' ' git commit --amend --date="$GIT_AUTHOR_DATE" && - git rebase --apply --ignore-date HEAD^ && + git rebase --apply --reset-author-date HEAD^ && test_atime_is_ignored -1 ' -test_expect_success '--ignore-date works with merge backend' ' +test_expect_success '--reset-author-date works with merge backend' ' git commit --amend --date="$GIT_AUTHOR_DATE" && - git rebase --ignore-date -m HEAD^ && + git rebase --reset-author-date -m HEAD^ && test_atime_is_ignored -1 ' -test_expect_success '--ignore-date works after conflict resolution' ' - test_must_fail git rebase --ignore-date -m \ +test_expect_success '--reset-author-date works after conflict resolution' ' + test_must_fail git rebase --reset-author-date -m \ --onto commit2^^ commit2^ commit2 && echo resolved >foo && git add foo && @@ -138,16 +138,16 @@ test_expect_success '--ignore-date works after conflict resolution' ' test_atime_is_ignored -1 ' -test_expect_success '--ignore-date works with rebase -r' ' +test_expect_success '--reset-author-date works with rebase -r' ' git checkout side && git merge --no-ff commit3 && - git rebase -r --root --ignore-date && + git rebase -r --root --reset-author-date && test_atime_is_ignored ' -test_expect_success '--ignore-date with --committer-date-is-author-date works' ' +test_expect_success '--reset-author-date with --committer-date-is-author-date works' ' test_must_fail git rebase -m --committer-date-is-author-date \ - --ignore-date --onto commit2^^ commit2^ commit3 && + --reset-author-date --onto commit2^^ commit2^ commit3 && git checkout --theirs foo && git add foo && git rebase --continue && @@ -155,15 +155,23 @@ test_expect_success '--ignore-date with --committer-date-is-author-date works' ' test_atime_is_ignored -2 ' -test_expect_success '--ignore-date --committer-date-is-author-date works when forking merge' ' +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 \ - --ignore-date --committer-date-is-author-date \ - side side && + --reset-author-date \ + --committer-date-is-author-date side side && test_ctime_is_atime -1 && test_atime_is_ignored -1 ' +test_expect_success '--ignore-date is an alias for --reset-author-date' ' + git commit --amend --date="$GIT_AUTHOR_DATE" && + git rebase --apply --ignore-date HEAD^ && + git commit --allow-empty -m empty --date="$GIT_AUTHOR_DATE" && + git rebase -m --ignore-date HEAD^ && + test_atime_is_ignored -2 +' + # This must be the last test in this file test_expect_success '$EDITOR and friends are unchanged' ' test_editor_unchanged |