diff options
Diffstat (limited to 't/t4202-log.sh')
-rwxr-xr-x | t/t4202-log.sh | 57 |
1 files changed, 48 insertions, 9 deletions
diff --git a/t/t4202-log.sh b/t/t4202-log.sh index 64502e2be7..1dc224f6fb 100755 --- a/t/t4202-log.sh +++ b/t/t4202-log.sh @@ -64,6 +64,27 @@ test_expect_success 'format' ' ' cat > expect << EOF + This is + the sixth + commit. + This is + the fifth + commit. +EOF + +test_expect_success 'format %w(12,1,2)' ' + + git log -2 --format="%w(12,1,2)This is the %s commit." > actual && + test_cmp expect actual +' + +test_expect_success 'format %w(,1,2)' ' + + git log -2 --format="%w(,1,2)This is%nthe %s%ncommit." > actual && + test_cmp expect actual +' + +cat > expect << EOF 804a787 sixth 394ef78 fifth 5d31159 fourth @@ -149,6 +170,26 @@ test_expect_success 'git log --follow' ' ' +cat > expect << EOF +804a787 sixth +394ef78 fifth +5d31159 fourth +EOF +test_expect_success 'git log --no-walk <commits> sorts by commit time' ' + git log --no-walk --oneline 5d31159 804a787 394ef78 > actual && + test_cmp expect actual +' + +cat > expect << EOF +5d31159 fourth +804a787 sixth +394ef78 fifth +EOF +test_expect_success 'git show <commits> leaves list of commits as given' ' + git show --oneline -s 5d31159 804a787 394ef78 > actual && + test_cmp expect actual +' + test_expect_success 'setup case sensitivity tests' ' echo case >one && test_tick && @@ -214,7 +255,7 @@ EOF test_expect_success 'log --graph with merge' ' git log --graph --date-order --pretty=tformat:%s | - sed "s/ *$//" >actual && + sed "s/ *\$//" >actual && test_cmp expect actual ' @@ -274,7 +315,7 @@ EOF test_expect_success 'log --graph with full output' ' git log --graph --date-order --pretty=short | git name-rev --name-only --stdin | - sed "s/Merge:.*/Merge: A B/;s/ *$//" >actual && + sed "s/Merge:.*/Merge: A B/;s/ *\$//" >actual && test_cmp expect actual ' @@ -300,11 +341,11 @@ test_expect_success 'set up more tangled history' ' ' cat > expect <<\EOF -* Merge branch 'reach' +* Merge commit 'reach' |\ | \ | \ -*-. \ Merge branches 'octopus-a' and 'octopus-b' +*-. \ Merge commit 'octopus-a'; commit 'octopus-b' |\ \ \ * | | | seventh | | * | octopus-b @@ -324,14 +365,12 @@ cat > expect <<\EOF * | | | Merge branch 'side' |\ \ \ \ | * | | | side-2 -| | | |/ -| | |/| +| | |_|/ | |/| | | * | | side-1 * | | | Second * | | | sixth -| | |/ -| |/| +| |_|/ |/| | * | | fifth * | | fourth @@ -344,7 +383,7 @@ EOF test_expect_success 'log --graph with merge' ' git log --graph --date-order --pretty=tformat:%s | - sed "s/ *$//" >actual && + sed "s/ *\$//" >actual && test_cmp expect actual ' |