From 93ba78d6f4632ef1c5228965e3edc8c0faf88c1e Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 26 May 2020 00:06:52 +0100 Subject: revert(3p/git): Revert merge of git upstream at v2.26.2 This causes cgit to serve error pages, which is undesirable. This reverts commit 5229c9b232de5bfa959ad6ebbb4c8192ac513352, reversing changes made to f2b211131f2347342dde63975b09cf603149f1a3. --- third_party/git/t/t4214-log-graph-octopus.sh | 339 ++++----------------------- 1 file changed, 47 insertions(+), 292 deletions(-) (limited to 'third_party/git/t/t4214-log-graph-octopus.sh') diff --git a/third_party/git/t/t4214-log-graph-octopus.sh b/third_party/git/t/t4214-log-graph-octopus.sh index a08032509840..dab96c89aa8a 100755 --- a/third_party/git/t/t4214-log-graph-octopus.sh +++ b/third_party/git/t/t4214-log-graph-octopus.sh @@ -3,86 +3,82 @@ test_description='git log --graph of skewed left octopus merge.' . ./test-lib.sh -. "$TEST_DIRECTORY"/lib-log-graph.sh - -test_cmp_graph () { - cat >expect && - lib_test_cmp_graph --color=never --date-order --format=%s "$@" -} - -test_cmp_colored_graph () { - lib_test_cmp_colored_graph --date-order --format=%s "$@" -} test_expect_success 'set up merge history' ' - test_commit initial && - for i in 1 2 3 4 ; do - git checkout master -b $i || return $? - # Make tag name different from branch name, to avoid - # ambiguity error when calling checkout. - test_commit $i $i $i tag$i || return $? - done && - git checkout 1 -b merge && - test_merge octopus-merge 1 2 3 4 && - test_commit after-merge && - git checkout 1 -b L && - test_commit left && - git checkout 4 -b crossover && - test_commit after-4 && - git checkout initial -b more-L && - test_commit after-initial -' - -test_expect_success 'log --graph with tricky octopus merge, no color' ' - test_cmp_graph left octopus-merge <<-\EOF + cat >expect.uncolored <<-\EOF && * left - | *-. octopus-merge - |/|\ \ + | *---. octopus-merge + | |\ \ \ + |/ / / / | | | * 4 | | * | 3 | | |/ - | * / 2 + | * | 2 | |/ - * / 1 + * | 1 |/ * initial EOF -' - -test_expect_success 'log --graph with tricky octopus merge with colors' ' - test_config log.graphColors red,green,yellow,blue,magenta,cyan && cat >expect.colors <<-\EOF && * left - | *-. octopus-merge - |/|\ \ + | *---. octopus-merge + | |\ \ \ + |/ / / / | | | * 4 | | * | 3 | | |/ - | * / 2 + | * | 2 | |/ - * / 1 + * | 1 |/ * initial EOF - test_cmp_colored_graph left octopus-merge + test_commit initial && + for i in 1 2 3 4 ; do + git checkout master -b $i || return $? + # Make tag name different from branch name, to avoid + # ambiguity error when calling checkout. + test_commit $i $i $i tag$i || return $? + done && + git checkout 1 -b merge && + test_tick && + git merge -m octopus-merge 1 2 3 4 && + git checkout 1 -b L && + test_commit left +' + +test_expect_success 'log --graph with tricky octopus merge with colors' ' + test_config log.graphColors red,green,yellow,blue,magenta,cyan && + git log --color=always --graph --date-order --pretty=tformat:%s --all >actual.colors.raw && + test_decode_color actual.colors && + test_cmp expect.colors actual.colors +' + +test_expect_success 'log --graph with tricky octopus merge, no color' ' + git log --color=never --graph --date-order --pretty=tformat:%s --all >actual.raw && + sed "s/ *\$//" actual.raw >actual && + test_cmp expect.uncolored actual ' # Repeat the previous two tests with "normal" octopus merge (i.e., # without the first parent skewing to the "left" branch column). test_expect_success 'log --graph with normal octopus merge, no color' ' - test_cmp_graph octopus-merge <<-\EOF + cat >expect.uncolored <<-\EOF && *---. octopus-merge |\ \ \ | | | * 4 | | * | 3 | | |/ - | * / 2 + | * | 2 | |/ - * / 1 + * | 1 |/ * initial EOF + git log --color=never --graph --date-order --pretty=tformat:%s merge >actual.raw && + sed "s/ *\$//" actual.raw >actual && + test_cmp expect.uncolored actual ' test_expect_success 'log --graph with normal octopus merge with colors' ' @@ -92,256 +88,15 @@ test_expect_success 'log --graph with normal octopus merge with colors' ' | | | * 4 | | * | 3 | | |/ - | * / 2 + | * | 2 | |/ - * / 1 + * | 1 |/ * initial EOF test_config log.graphColors red,green,yellow,blue,magenta,cyan && - test_cmp_colored_graph octopus-merge + git log --color=always --graph --date-order --pretty=tformat:%s merge >actual.colors.raw && + test_decode_color actual.colors && + test_cmp expect.colors actual.colors ' - -test_expect_success 'log --graph with normal octopus merge and child, no color' ' - test_cmp_graph after-merge <<-\EOF - * after-merge - *---. octopus-merge - |\ \ \ - | | | * 4 - | | * | 3 - | | |/ - | * / 2 - | |/ - * / 1 - |/ - * initial - EOF -' - -test_expect_success 'log --graph with normal octopus and child merge with colors' ' - cat >expect.colors <<-\EOF && - * after-merge - *---. octopus-merge - |\ \ \ - | | | * 4 - | | * | 3 - | | |/ - | * / 2 - | |/ - * / 1 - |/ - * initial - EOF - test_config log.graphColors red,green,yellow,blue,magenta,cyan && - test_cmp_colored_graph after-merge -' - -test_expect_success 'log --graph with tricky octopus merge and its child, no color' ' - test_cmp_graph left after-merge <<-\EOF - * left - | * after-merge - | *-. octopus-merge - |/|\ \ - | | | * 4 - | | * | 3 - | | |/ - | * / 2 - | |/ - * / 1 - |/ - * initial - EOF -' - -test_expect_success 'log --graph with tricky octopus merge and its child with colors' ' - test_config log.graphColors red,green,yellow,blue,magenta,cyan && - cat >expect.colors <<-\EOF && - * left - | * after-merge - | *-. octopus-merge - |/|\ \ - | | | * 4 - | | * | 3 - | | |/ - | * / 2 - | |/ - * / 1 - |/ - * initial - EOF - test_cmp_colored_graph left after-merge -' - -test_expect_success 'log --graph with crossover in octopus merge, no color' ' - test_cmp_graph after-4 octopus-merge <<-\EOF - * after-4 - | *---. octopus-merge - | |\ \ \ - | |_|_|/ - |/| | | - * | | | 4 - | | | * 3 - | |_|/ - |/| | - | | * 2 - | |/ - |/| - | * 1 - |/ - * initial - EOF -' - -test_expect_success 'log --graph with crossover in octopus merge with colors' ' - test_config log.graphColors red,green,yellow,blue,magenta,cyan && - cat >expect.colors <<-\EOF && - * after-4 - | *---. octopus-merge - | |\ \ \ - | |_|_|/ - |/| | | - * | | | 4 - | | | * 3 - | |_|/ - |/| | - | | * 2 - | |/ - |/| - | * 1 - |/ - * initial - EOF - test_cmp_colored_graph after-4 octopus-merge -' - -test_expect_success 'log --graph with crossover in octopus merge and its child, no color' ' - test_cmp_graph after-4 after-merge <<-\EOF - * after-4 - | * after-merge - | *---. octopus-merge - | |\ \ \ - | |_|_|/ - |/| | | - * | | | 4 - | | | * 3 - | |_|/ - |/| | - | | * 2 - | |/ - |/| - | * 1 - |/ - * initial - EOF -' - -test_expect_success 'log --graph with crossover in octopus merge and its child with colors' ' - test_config log.graphColors red,green,yellow,blue,magenta,cyan && - cat >expect.colors <<-\EOF && - * after-4 - | * after-merge - | *---. octopus-merge - | |\ \ \ - | |_|_|/ - |/| | | - * | | | 4 - | | | * 3 - | |_|/ - |/| | - | | * 2 - | |/ - |/| - | * 1 - |/ - * initial - EOF - test_cmp_colored_graph after-4 after-merge -' - -test_expect_success 'log --graph with unrelated commit and octopus tip, no color' ' - test_cmp_graph after-initial octopus-merge <<-\EOF - * after-initial - | *---. octopus-merge - | |\ \ \ - | | | | * 4 - | |_|_|/ - |/| | | - | | | * 3 - | |_|/ - |/| | - | | * 2 - | |/ - |/| - | * 1 - |/ - * initial - EOF -' - -test_expect_success 'log --graph with unrelated commit and octopus tip with colors' ' - test_config log.graphColors red,green,yellow,blue,magenta,cyan && - cat >expect.colors <<-\EOF && - * after-initial - | *---. octopus-merge - | |\ \ \ - | | | | * 4 - | |_|_|/ - |/| | | - | | | * 3 - | |_|/ - |/| | - | | * 2 - | |/ - |/| - | * 1 - |/ - * initial - EOF - test_cmp_colored_graph after-initial octopus-merge -' - -test_expect_success 'log --graph with unrelated commit and octopus child, no color' ' - test_cmp_graph after-initial after-merge <<-\EOF - * after-initial - | * after-merge - | *---. octopus-merge - | |\ \ \ - | | | | * 4 - | |_|_|/ - |/| | | - | | | * 3 - | |_|/ - |/| | - | | * 2 - | |/ - |/| - | * 1 - |/ - * initial - EOF -' - -test_expect_success 'log --graph with unrelated commit and octopus child with colors' ' - test_config log.graphColors red,green,yellow,blue,magenta,cyan && - cat >expect.colors <<-\EOF && - * after-initial - | * after-merge - | *---. octopus-merge - | |\ \ \ - | | | | * 4 - | |_|_|/ - |/| | | - | | | * 3 - | |_|/ - |/| | - | | * 2 - | |/ - |/| - | * 1 - |/ - * initial - EOF - test_cmp_colored_graph after-initial after-merge -' - test_done -- cgit 1.4.1