| 1 | #!/bin/sh |
| 2 | |
| 3 | test_description='git log with filter options limiting the output' |
| 4 | |
| 5 | . ./test-lib.sh |
| 6 | |
| 7 | test_expect_success 'setup test' ' |
| 8 | git init && |
| 9 | echo a >file && |
| 10 | git add file && |
| 11 | GIT_COMMITTER_DATE="2021-02-01 00:00" git commit -m init && |
| 12 | echo a >>file && |
| 13 | git add file && |
| 14 | GIT_COMMITTER_DATE="2022-02-01 00:00" git commit -m first && |
| 15 | echo a >>file && |
| 16 | git add file && |
| 17 | GIT_COMMITTER_DATE="2021-03-01 00:00" git commit -m second && |
| 18 | echo a >>file && |
| 19 | git add file && |
| 20 | GIT_COMMITTER_DATE="2022-03-01 00:00" git commit -m third |
| 21 | ' |
| 22 | |
| 23 | test_expect_success 'git log --since-as-filter=...' ' |
| 24 | git log --since-as-filter="2022-01-01" --format=%s >actual && |
| 25 | cat >expect <<-\EOF && |
| 26 | third |
| 27 | first |
| 28 | EOF |
| 29 | test_cmp expect actual |
| 30 | ' |
| 31 | |
| 32 | test_expect_success 'git log --children --since-as-filter=...' ' |
| 33 | git log --children --since-as-filter="2022-01-01" --format=%s >actual && |
| 34 | cat >expect <<-\EOF && |
| 35 | third |
| 36 | first |
| 37 | EOF |
| 38 | test_cmp expect actual |
| 39 | ' |
| 40 | |
| 41 | test_done |