Skip to content

Commit afc3319

Browse files
committed
test: catch squash author comparison issue
There is a bug in squash where author comparison uses the entire author signature, including the author time, to determine whether all the commits being squashed are by the same author. The test case for this behavior creates patches fast enough that they all share the same author time. Add artifical author times to the test patches to trigger the bug.
1 parent f06ff66 commit afc3319

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

t/t2600-squash.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@ test_expect_success 'Squash at stack top' '
7373

7474
test_expect_success 'Squash patches with all non-default author' '
7575
echo "a" >>baz.txt &&
76-
stg new -rm "a-patch" --author "Other Contributor <[email protected]>" &&
76+
stg new -rm "a-patch" --author "Other Contributor <[email protected]>" --authdate 1762750000 &&
7777
echo "b" >>baz.txt &&
78-
stg new -rm "b-patch" --author "Other Contributor <[email protected]>" &&
78+
stg new -rm "b-patch" --author "Other Contributor <[email protected]>" --authdate 1762760000 &&
7979
echo "c" >>baz.txt &&
80-
stg new -rm "c-patch" --author "Other Contributor <[email protected]>" &&
80+
stg new -rm "c-patch" --author "Other Contributor <[email protected]>" --authdate 1762770000 &&
8181
stg squash -m "abc-patch" a-patch b-patch c-patch &&
8282
test_when_finished "stg delete abc-patch" &&
8383
stg show abc-patch | grep "Author:" >out &&

0 commit comments

Comments
 (0)