The eleventh batch
[git/gitster.git] / t / t4217-log-limit.sh
blob613f0710e90511c6419e843eec3cb4d11aafc437
1 #!/bin/sh
3 test_description='git log with filter options limiting the output'
5 TEST_PASSES_SANITIZE_LEAK=true
6 . ./test-lib.sh
8 test_expect_success 'setup test' '
9 git init &&
10 echo a >file &&
11 git add file &&
12 GIT_COMMITTER_DATE="2021-02-01 00:00" git commit -m init &&
13 echo a >>file &&
14 git add file &&
15 GIT_COMMITTER_DATE="2022-02-01 00:00" git commit -m first &&
16 echo a >>file &&
17 git add file &&
18 GIT_COMMITTER_DATE="2021-03-01 00:00" git commit -m second &&
19 echo a >>file &&
20 git add file &&
21 GIT_COMMITTER_DATE="2022-03-01 00:00" git commit -m third
24 test_expect_success 'git log --since-as-filter=...' '
25 git log --since-as-filter="2022-01-01" --format=%s >actual &&
26 cat >expect <<-\EOF &&
27 third
28 first
29 EOF
30 test_cmp expect actual
33 test_expect_success 'git log --children --since-as-filter=...' '
34 git log --children --since-as-filter="2022-01-01" --format=%s >actual &&
35 cat >expect <<-\EOF &&
36 third
37 first
38 EOF
39 test_cmp expect actual
42 test_done