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. --- .../git/t/t7501-commit-basic-functionality.sh | 83 ++++++++++------------ 1 file changed, 37 insertions(+), 46 deletions(-) (limited to 'third_party/git/t/t7501-commit-basic-functionality.sh') diff --git a/third_party/git/t/t7501-commit-basic-functionality.sh b/third_party/git/t/t7501-commit-basic-functionality.sh index 110b4bf459bf..f1349af56edd 100755 --- a/third_party/git/t/t7501-commit-basic-functionality.sh +++ b/third_party/git/t/t7501-commit-basic-functionality.sh @@ -150,7 +150,7 @@ test_expect_success 'setup: commit message from file' ' test_expect_success 'amend commit' ' cat >editor <<-\EOF && #!/bin/sh - sed -e "s/a file/an amend commit/g" <"$1" >"$1-" + sed -e "s/a file/an amend commit/g" < "$1" > "$1-" mv "$1-" "$1" EOF chmod 755 editor && @@ -263,7 +263,7 @@ test_expect_success 'using message from other commit' ' test_expect_success 'editing message from other commit' ' cat >editor <<-\EOF && #!/bin/sh - sed -e "s/amend/older/g" <"$1" >"$1-" + sed -e "s/amend/older/g" < "$1" > "$1-" mv "$1-" "$1" EOF chmod 755 editor && @@ -285,8 +285,9 @@ test_expect_success 'overriding author from command line' ' ' test_expect_success PERL 'interactive add' ' - echo 7 | test_must_fail git commit --interactive >out && - grep "What now" out + echo 7 | + git commit --interactive | + grep "What now" ' test_expect_success PERL "commit --interactive doesn't change index if editor aborts" ' @@ -361,12 +362,12 @@ test_expect_success 'amend commit to fix author' ' oldtick=$GIT_AUTHOR_DATE && test_tick && git reset --hard && - git cat-file -p HEAD >commit && + git cat-file -p HEAD | sed -e "s/author.*/author $author $oldtick/" \ - -e "s/^\(committer.*> \).*$/\1$GIT_COMMITTER_DATE/" \ - commit >expected && + -e "s/^\(committer.*> \).*$/\1$GIT_COMMITTER_DATE/" > \ + expected && git commit --amend --author="$author" && - git cat-file -p HEAD >current && + git cat-file -p HEAD > current && test_cmp expected current ' @@ -376,12 +377,12 @@ test_expect_success 'amend commit to fix date' ' test_tick && newtick=$GIT_AUTHOR_DATE && git reset --hard && - git cat-file -p HEAD >commit && + git cat-file -p HEAD | sed -e "s/author.*/author $author $newtick/" \ - -e "s/^\(committer.*> \).*$/\1$GIT_COMMITTER_DATE/" \ - commit >expected && + -e "s/^\(committer.*> \).*$/\1$GIT_COMMITTER_DATE/" > \ + expected && git commit --amend --date="$newtick" && - git cat-file -p HEAD >current && + git cat-file -p HEAD > current && test_cmp expected current ' @@ -408,13 +409,12 @@ test_expect_success 'sign off (1)' ' echo 1 >positive && git add positive && git commit -s -m "thank you" && - git cat-file commit HEAD >commit && - sed -e "1,/^\$/d" commit >actual && + git cat-file commit HEAD | sed -e "1,/^\$/d" >actual && ( echo thank you && echo && - git var GIT_COMMITTER_IDENT >ident && - sed -e "s/>.*/>/" -e "s/^/Signed-off-by: /" ident + git var GIT_COMMITTER_IDENT | + sed -e "s/>.*/>/" -e "s/^/Signed-off-by: /" ) >expected && test_cmp expected actual @@ -428,14 +428,13 @@ test_expect_success 'sign off (2)' ' git commit -s -m "thank you $existing" && - git cat-file commit HEAD >commit && - sed -e "1,/^\$/d" commit >actual && + git cat-file commit HEAD | sed -e "1,/^\$/d" >actual && ( echo thank you && echo && echo $existing && - git var GIT_COMMITTER_IDENT >ident && - sed -e "s/>.*/>/" -e "s/^/Signed-off-by: /" ident + git var GIT_COMMITTER_IDENT | + sed -e "s/>.*/>/" -e "s/^/Signed-off-by: /" ) >expected && test_cmp expected actual @@ -449,14 +448,13 @@ test_expect_success 'signoff gap' ' git commit -s -m "welcome $alt" && - git cat-file commit HEAD >commit && - sed -e "1,/^\$/d" commit >actual && + git cat-file commit HEAD | sed -e "1,/^\$/d" > actual && ( echo welcome && echo && echo $alt && - git var GIT_COMMITTER_IDENT >ident && - sed -e "s/>.*/>/" -e "s/^/Signed-off-by: /" ident + git var GIT_COMMITTER_IDENT | + sed -e "s/>.*/>/" -e "s/^/Signed-off-by: /" ) >expected && test_cmp expected actual ' @@ -470,16 +468,15 @@ test_expect_success 'signoff gap 2' ' We have now $alt" && - git cat-file commit HEAD >commit && - sed -e "1,/^\$/d" commit >actual && + git cat-file commit HEAD | sed -e "1,/^\$/d" > actual && ( echo welcome && echo && echo We have now && echo $alt && echo && - git var GIT_COMMITTER_IDENT >ident && - sed -e "s/>.*/>/" -e "s/^/Signed-off-by: /" ident + git var GIT_COMMITTER_IDENT | + sed -e "s/>.*/>/" -e "s/^/Signed-off-by: /" ) >expected && test_cmp expected actual ' @@ -492,8 +489,7 @@ test_expect_success 'signoff respects trailer config' ' non-trailer line Myfooter: x" && - git cat-file commit HEAD >commit && - sed -e "1,/^\$/d" commit >actual && + git cat-file commit HEAD | sed -e "1,/^\$/d" > actual && ( echo subject && echo && @@ -510,8 +506,7 @@ Myfooter: x" && non-trailer line Myfooter: x" && - git cat-file commit HEAD >commit && - sed -e "1,/^\$/d" commit >actual && + git cat-file commit HEAD | sed -e "1,/^\$/d" > actual && ( echo subject && echo && @@ -543,8 +538,7 @@ test_expect_success 'multiple -m' ' >negative && git add negative && git commit -m "one" -m "two" -m "three" && - git cat-file commit HEAD >commit && - sed -e "1,/^\$/d" commit >actual && + git cat-file commit HEAD | sed -e "1,/^\$/d" >actual && ( echo one && echo && @@ -561,25 +555,23 @@ test_expect_success 'amend commit to fix author' ' oldtick=$GIT_AUTHOR_DATE && test_tick && git reset --hard && - git cat-file -p HEAD >commit && + git cat-file -p HEAD | sed -e "s/author.*/author $author $oldtick/" \ - -e "s/^\(committer.*> \).*$/\1$GIT_COMMITTER_DATE/" \ - commit >expected && + -e "s/^\(committer.*> \).*$/\1$GIT_COMMITTER_DATE/" > \ + expected && git commit --amend --author="$author" && - git cat-file -p HEAD >current && + git cat-file -p HEAD > current && test_cmp expected current ' test_expect_success 'git commit with dirty index' ' - echo tacocat >elif && - echo tehlulz >chz && + echo tacocat > elif && + echo tehlulz > chz && git add chz && git commit elif -m "tacocat is a palindrome" && - git show --stat >stat && - grep elif stat && - git diff --cached >diff && - grep chz diff + git show --stat | grep elif && + git diff --cached | grep chz ' test_expect_success 'same tree (single parent)' ' @@ -592,8 +584,7 @@ test_expect_success 'same tree (single parent)' ' test_expect_success 'same tree (single parent) --allow-empty' ' git commit --allow-empty -m "forced empty" && - git cat-file commit HEAD >commit && - grep forced commit + git cat-file commit HEAD | grep forced ' -- cgit 1.4.1