diff options
author | Han-Wen Nienhuys <hanwen@google.com> | 2021-12-02 17:36:29 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-12-02 11:14:07 -0800 |
commit | f2463490c4ee3beded70bf69e49fb23552796ddc (patch) | |
tree | b15939229880d99a80f198785d79775dfc3c7734 /t/t3202-show-branch.sh | |
parent | The first batch to start the current cycle (diff) | |
download | tgif-f2463490c4ee3beded70bf69e49fb23552796ddc.tar.xz |
show-branch: show reflog message
Before, --reflog option would look for '\t' in the reflog message. As refs.c
already parses the reflog line, the '\t' was never found, and show-branch
--reflog would always say "(none)" as reflog message
Add test.
Signed-off-by: Han-Wen Nienhuys <hanwen@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3202-show-branch.sh')
-rwxr-xr-x | t/t3202-show-branch.sh | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/t/t3202-show-branch.sh b/t/t3202-show-branch.sh index ad9902a06b..d4d64401e4 100755 --- a/t/t3202-show-branch.sh +++ b/t/t3202-show-branch.sh @@ -4,6 +4,9 @@ test_description='test show-branch' . ./test-lib.sh +# arbitrary reference time: 2009-08-30 19:20:00 +GIT_TEST_DATE_NOW=1251660000; export GIT_TEST_DATE_NOW + test_expect_success 'setup' ' test_commit initial && for i in $(test_seq 1 10) @@ -146,4 +149,16 @@ test_expect_success 'show branch --merge-base with N arguments' ' test_cmp expect actual ' +test_expect_success 'show branch --reflog=2' ' + sed "s/^> //" >expect <<-\EOF && + > ! [refs/heads/branch10@{0}] (4 years, 5 months ago) commit: branch10 + > ! [refs/heads/branch10@{1}] (4 years, 5 months ago) commit: branch10 + > -- + > + [refs/heads/branch10@{0}] branch10 + > ++ [refs/heads/branch10@{1}] initial + EOF + git show-branch --reflog=2 >actual && + test_cmp actual expect +' + test_done |