interplane.Get Omega
Read in your language

git

[Ported from github.com/git/git] Sync with Git 2.56.1

Brought by drakestapleton

branch master Branches Tags History

git / t / t4217-log-limit.sh

41 lines · 937 bytes Raw Blame History
1#!/bin/sh
2
3test_description='git log with filter options limiting the output'
4
5. ./test-lib.sh
6
7test_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
23test_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
32test_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
41test_done