]> git.ipfire.org Git - thirdparty/git.git/blame - t/t4217-log-limit.sh
Sync with Git 2.45.1
[thirdparty/git.git] / t / t4217-log-limit.sh
CommitLineData
96697781
MV
1#!/bin/sh
2
3test_description='git log with filter options limiting the output'
4
8ef8da48 5TEST_PASSES_SANITIZE_LEAK=true
96697781
MV
6. ./test-lib.sh
7
8test_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
22'
23
24test_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
31'
32
33test_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
40'
41
42test_done