Skip to content

Commit 56706db

Browse files
peffgitster
authored andcommitted
t3436: check --committer-date-is-author-date result more carefully
After running "rebase --committer-date-is-author-date", we confirm that the committer date is the same as the author date. However, we don't look at any other parts of the committer ident line to make sure we didn't screw them up. And indeed, there are a few bugs here. Depending on the rebase backend in use, we may accidentally use the author email instead of the committer's, or even an empty string. Let's teach our test_ctime_is_atime helper to check the committer name and email, which reveals several failing tests. Signed-off-by: Jeff King <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 6160b2e commit 56706db

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

t/t3436-rebase-more-options.sh

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,31 +65,31 @@ test_expect_success '--ignore-whitespace is remembered when continuing' '
6565
'
6666

6767
test_ctime_is_atime () {
68-
git log $1 --format=%ai >authortime &&
69-
git log $1 --format=%ci >committertime &&
68+
git log $1 --format="$GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> %ai" >authortime &&
69+
git log $1 --format="%cn <%ce> %ci" >committertime &&
7070
test_cmp authortime committertime
7171
}
7272

73-
test_expect_success '--committer-date-is-author-date works with apply backend' '
73+
test_expect_failure '--committer-date-is-author-date works with apply backend' '
7474
GIT_AUTHOR_DATE="@1234 +0300" git commit --amend --reset-author &&
7575
git rebase --apply --committer-date-is-author-date HEAD^ &&
7676
test_ctime_is_atime -1
7777
'
7878

79-
test_expect_success '--committer-date-is-author-date works with merge backend' '
79+
test_expect_failure '--committer-date-is-author-date works with merge backend' '
8080
GIT_AUTHOR_DATE="@1234 +0300" git commit --amend --reset-author &&
8181
git rebase -m --committer-date-is-author-date HEAD^ &&
8282
test_ctime_is_atime -1
8383
'
8484

85-
test_expect_success '--committer-date-is-author-date works with rebase -r' '
85+
test_expect_failure '--committer-date-is-author-date works with rebase -r' '
8686
git checkout side &&
8787
GIT_AUTHOR_DATE="@1234 +0300" git merge --no-ff commit3 &&
8888
git rebase -r --root --committer-date-is-author-date &&
8989
test_ctime_is_atime
9090
'
9191

92-
test_expect_success '--committer-date-is-author-date works when forking merge' '
92+
test_expect_failure '--committer-date-is-author-date works when forking merge' '
9393
git checkout side &&
9494
GIT_AUTHOR_DATE="@1234 +0300" git merge --no-ff commit3 &&
9595
PATH="./test-bin:$PATH" git rebase -r --root --strategy=test \
@@ -145,7 +145,7 @@ test_expect_success '--reset-author-date works with rebase -r' '
145145
test_atime_is_ignored
146146
'
147147

148-
test_expect_success '--reset-author-date with --committer-date-is-author-date works' '
148+
test_expect_failure '--reset-author-date with --committer-date-is-author-date works' '
149149
test_must_fail git rebase -m --committer-date-is-author-date \
150150
--reset-author-date --onto commit2^^ commit2^ commit3 &&
151151
git checkout --theirs foo &&

0 commit comments

Comments
 (0)