mirror of
https://github.com/git/git
synced 2024-08-27 19:49:21 +00:00
Merge branch 'pb/test-must-fail-is-for-git'
Test cleanup. * pb/test-must-fail-is-for-git: t9813: avoid using pipes don't use test_must_fail with grep
This commit is contained in:
commit
c7f352f31a
|
@ -385,7 +385,7 @@ test_expect_success '--continue respects opts' '
|
||||||
git cat-file commit HEAD~1 >picked_msg &&
|
git cat-file commit HEAD~1 >picked_msg &&
|
||||||
git cat-file commit HEAD~2 >unrelatedpick_msg &&
|
git cat-file commit HEAD~2 >unrelatedpick_msg &&
|
||||||
git cat-file commit HEAD~3 >initial_msg &&
|
git cat-file commit HEAD~3 >initial_msg &&
|
||||||
test_must_fail grep "cherry picked from" initial_msg &&
|
! grep "cherry picked from" initial_msg &&
|
||||||
grep "cherry picked from" unrelatedpick_msg &&
|
grep "cherry picked from" unrelatedpick_msg &&
|
||||||
grep "cherry picked from" picked_msg &&
|
grep "cherry picked from" picked_msg &&
|
||||||
grep "cherry picked from" anotherpick_msg
|
grep "cherry picked from" anotherpick_msg
|
||||||
|
@ -426,9 +426,9 @@ test_expect_failure '--signoff is automatically propagated to resolved conflict'
|
||||||
git cat-file commit HEAD~1 >picked_msg &&
|
git cat-file commit HEAD~1 >picked_msg &&
|
||||||
git cat-file commit HEAD~2 >unrelatedpick_msg &&
|
git cat-file commit HEAD~2 >unrelatedpick_msg &&
|
||||||
git cat-file commit HEAD~3 >initial_msg &&
|
git cat-file commit HEAD~3 >initial_msg &&
|
||||||
test_must_fail grep "Signed-off-by:" initial_msg &&
|
! grep "Signed-off-by:" initial_msg &&
|
||||||
grep "Signed-off-by:" unrelatedpick_msg &&
|
grep "Signed-off-by:" unrelatedpick_msg &&
|
||||||
test_must_fail grep "Signed-off-by:" picked_msg &&
|
! grep "Signed-off-by:" picked_msg &&
|
||||||
grep "Signed-off-by:" anotherpick_msg
|
grep "Signed-off-by:" anotherpick_msg
|
||||||
'
|
'
|
||||||
|
|
||||||
|
|
|
@ -152,7 +152,7 @@ test_expect_success 'push with receive.fsck.missingEmail=warn' '
|
||||||
git --git-dir=dst/.git config --add \
|
git --git-dir=dst/.git config --add \
|
||||||
receive.fsck.badDate warn &&
|
receive.fsck.badDate warn &&
|
||||||
git push --porcelain dst bogus >act 2>&1 &&
|
git push --porcelain dst bogus >act 2>&1 &&
|
||||||
test_must_fail grep "missingEmail" act
|
! grep "missingEmail" act
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success \
|
test_expect_success \
|
||||||
|
|
|
@ -1004,7 +1004,7 @@ test_expect_success 'push --porcelain' '
|
||||||
test_expect_success 'push --porcelain bad url' '
|
test_expect_success 'push --porcelain bad url' '
|
||||||
mk_empty testrepo &&
|
mk_empty testrepo &&
|
||||||
test_must_fail git push >.git/bar --porcelain asdfasdfasd refs/heads/master:refs/remotes/origin/master &&
|
test_must_fail git push >.git/bar --porcelain asdfasdfasd refs/heads/master:refs/remotes/origin/master &&
|
||||||
test_must_fail grep -q Done .git/bar
|
! grep -q Done .git/bar
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'push --porcelain rejected' '
|
test_expect_success 'push --porcelain rejected' '
|
||||||
|
|
|
@ -151,7 +151,7 @@ test_expect_success 'clone --mirror does not repeat tags' '
|
||||||
git clone --mirror src mirror2 &&
|
git clone --mirror src mirror2 &&
|
||||||
(cd mirror2 &&
|
(cd mirror2 &&
|
||||||
git show-ref 2> clone.err > clone.out) &&
|
git show-ref 2> clone.err > clone.out) &&
|
||||||
test_must_fail grep Duplicate mirror2/clone.err &&
|
! grep Duplicate mirror2/clone.err &&
|
||||||
grep some-tag mirror2/clone.out
|
grep some-tag mirror2/clone.out
|
||||||
|
|
||||||
'
|
'
|
||||||
|
|
|
@ -407,7 +407,7 @@ test_expect_success 'good merge base when good and bad are siblings' '
|
||||||
test_i18ngrep "merge base must be tested" my_bisect_log.txt &&
|
test_i18ngrep "merge base must be tested" my_bisect_log.txt &&
|
||||||
grep $HASH4 my_bisect_log.txt &&
|
grep $HASH4 my_bisect_log.txt &&
|
||||||
git bisect good > my_bisect_log.txt &&
|
git bisect good > my_bisect_log.txt &&
|
||||||
test_must_fail grep "merge base must be tested" my_bisect_log.txt &&
|
! grep "merge base must be tested" my_bisect_log.txt &&
|
||||||
grep $HASH6 my_bisect_log.txt &&
|
grep $HASH6 my_bisect_log.txt &&
|
||||||
git bisect reset
|
git bisect reset
|
||||||
'
|
'
|
||||||
|
|
|
@ -602,7 +602,7 @@ test_expect_success MKTEMP 'temporary filenames are used with mergetool.writeToT
|
||||||
test_config mergetool.myecho.trustExitCode true &&
|
test_config mergetool.myecho.trustExitCode true &&
|
||||||
test_must_fail git merge master &&
|
test_must_fail git merge master &&
|
||||||
git mergetool --no-prompt --tool myecho -- both >actual &&
|
git mergetool --no-prompt --tool myecho -- both >actual &&
|
||||||
test_must_fail grep ^\./both_LOCAL_ actual >/dev/null &&
|
! grep ^\./both_LOCAL_ actual >/dev/null &&
|
||||||
grep /both_LOCAL_ actual >/dev/null &&
|
grep /both_LOCAL_ actual >/dev/null &&
|
||||||
git reset --hard master >/dev/null 2>&1
|
git reset --hard master >/dev/null 2>&1
|
||||||
'
|
'
|
||||||
|
|
|
@ -50,7 +50,7 @@ test_no_confirm () {
|
||||||
--smtp-server="$(pwd)/fake.sendmail" \
|
--smtp-server="$(pwd)/fake.sendmail" \
|
||||||
$@ \
|
$@ \
|
||||||
$patches >stdout &&
|
$patches >stdout &&
|
||||||
test_must_fail grep "Send this email" stdout &&
|
! grep "Send this email" stdout &&
|
||||||
>no_confirm_okay
|
>no_confirm_okay
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -55,7 +55,7 @@ test_expect_success 'clone to target directory with --stdlayout' '
|
||||||
test_expect_success 'init without -s/-T/-b/-t does not warn' '
|
test_expect_success 'init without -s/-T/-b/-t does not warn' '
|
||||||
test ! -d trunk &&
|
test ! -d trunk &&
|
||||||
git svn init "$svnrepo"/project/trunk trunk 2>warning &&
|
git svn init "$svnrepo"/project/trunk trunk 2>warning &&
|
||||||
test_must_fail grep -q prefix warning &&
|
! grep -q prefix warning &&
|
||||||
rm -rf trunk &&
|
rm -rf trunk &&
|
||||||
rm -f warning
|
rm -f warning
|
||||||
'
|
'
|
||||||
|
@ -63,7 +63,7 @@ test_expect_success 'init without -s/-T/-b/-t does not warn' '
|
||||||
test_expect_success 'clone without -s/-T/-b/-t does not warn' '
|
test_expect_success 'clone without -s/-T/-b/-t does not warn' '
|
||||||
test ! -d trunk &&
|
test ! -d trunk &&
|
||||||
git svn clone "$svnrepo"/project/trunk 2>warning &&
|
git svn clone "$svnrepo"/project/trunk 2>warning &&
|
||||||
test_must_fail grep -q prefix warning &&
|
! grep -q prefix warning &&
|
||||||
rm -rf trunk &&
|
rm -rf trunk &&
|
||||||
rm -f warning
|
rm -f warning
|
||||||
'
|
'
|
||||||
|
@ -86,7 +86,7 @@ EOF
|
||||||
test_expect_success 'init with -s/-T/-b/-t assumes --prefix=origin/' '
|
test_expect_success 'init with -s/-T/-b/-t assumes --prefix=origin/' '
|
||||||
test ! -d project &&
|
test ! -d project &&
|
||||||
git svn init -s "$svnrepo"/project project 2>warning &&
|
git svn init -s "$svnrepo"/project project 2>warning &&
|
||||||
test_must_fail grep -q prefix warning &&
|
! grep -q prefix warning &&
|
||||||
test_svn_configured_prefix "origin/" &&
|
test_svn_configured_prefix "origin/" &&
|
||||||
rm -rf project &&
|
rm -rf project &&
|
||||||
rm -f warning
|
rm -f warning
|
||||||
|
@ -95,7 +95,7 @@ test_expect_success 'init with -s/-T/-b/-t assumes --prefix=origin/' '
|
||||||
test_expect_success 'clone with -s/-T/-b/-t assumes --prefix=origin/' '
|
test_expect_success 'clone with -s/-T/-b/-t assumes --prefix=origin/' '
|
||||||
test ! -d project &&
|
test ! -d project &&
|
||||||
git svn clone -s "$svnrepo"/project 2>warning &&
|
git svn clone -s "$svnrepo"/project 2>warning &&
|
||||||
test_must_fail grep -q prefix warning &&
|
! grep -q prefix warning &&
|
||||||
test_svn_configured_prefix "origin/" &&
|
test_svn_configured_prefix "origin/" &&
|
||||||
rm -rf project &&
|
rm -rf project &&
|
||||||
rm -f warning
|
rm -f warning
|
||||||
|
@ -104,7 +104,7 @@ test_expect_success 'clone with -s/-T/-b/-t assumes --prefix=origin/' '
|
||||||
test_expect_success 'init with -s/-T/-b/-t and --prefix "" still works' '
|
test_expect_success 'init with -s/-T/-b/-t and --prefix "" still works' '
|
||||||
test ! -d project &&
|
test ! -d project &&
|
||||||
git svn init -s "$svnrepo"/project project --prefix "" 2>warning &&
|
git svn init -s "$svnrepo"/project project --prefix "" 2>warning &&
|
||||||
test_must_fail grep -q prefix warning &&
|
! grep -q prefix warning &&
|
||||||
test_svn_configured_prefix "" &&
|
test_svn_configured_prefix "" &&
|
||||||
rm -rf project &&
|
rm -rf project &&
|
||||||
rm -f warning
|
rm -f warning
|
||||||
|
@ -113,7 +113,7 @@ test_expect_success 'init with -s/-T/-b/-t and --prefix "" still works' '
|
||||||
test_expect_success 'clone with -s/-T/-b/-t and --prefix "" still works' '
|
test_expect_success 'clone with -s/-T/-b/-t and --prefix "" still works' '
|
||||||
test ! -d project &&
|
test ! -d project &&
|
||||||
git svn clone -s "$svnrepo"/project --prefix "" 2>warning &&
|
git svn clone -s "$svnrepo"/project --prefix "" 2>warning &&
|
||||||
test_must_fail grep -q prefix warning &&
|
! grep -q prefix warning &&
|
||||||
test_svn_configured_prefix "" &&
|
test_svn_configured_prefix "" &&
|
||||||
rm -rf project &&
|
rm -rf project &&
|
||||||
rm -f warning
|
rm -f warning
|
||||||
|
|
|
@ -118,21 +118,21 @@ test_expect_success 'not preserving user with mixed authorship' '
|
||||||
make_change_by_user usernamefile3 Derek derek@example.com &&
|
make_change_by_user usernamefile3 Derek derek@example.com &&
|
||||||
P4EDITOR=cat P4USER=alice P4PASSWD=secret &&
|
P4EDITOR=cat P4USER=alice P4PASSWD=secret &&
|
||||||
export P4EDITOR P4USER P4PASSWD &&
|
export P4EDITOR P4USER P4PASSWD &&
|
||||||
git p4 commit |\
|
git p4 commit >actual &&
|
||||||
grep "git author derek@example.com does not match" &&
|
grep "git author derek@example.com does not match" actual &&
|
||||||
|
|
||||||
make_change_by_user usernamefile3 Charlie charlie@example.com &&
|
make_change_by_user usernamefile3 Charlie charlie@example.com &&
|
||||||
git p4 commit |\
|
git p4 commit >actual &&
|
||||||
grep "git author charlie@example.com does not match" &&
|
grep "git author charlie@example.com does not match" actual &&
|
||||||
|
|
||||||
make_change_by_user usernamefile3 alice alice@example.com &&
|
make_change_by_user usernamefile3 alice alice@example.com &&
|
||||||
git p4 commit |\
|
git p4 commit >actual &&
|
||||||
test_must_fail grep "git author.*does not match" &&
|
! grep "git author.*does not match" actual &&
|
||||||
|
|
||||||
git config git-p4.skipUserNameCheck true &&
|
git config git-p4.skipUserNameCheck true &&
|
||||||
make_change_by_user usernamefile3 Charlie charlie@example.com &&
|
make_change_by_user usernamefile3 Charlie charlie@example.com &&
|
||||||
git p4 commit |\
|
git p4 commit >actual &&
|
||||||
test_must_fail grep "git author.*does not match" &&
|
! grep "git author.*does not match" actual &&
|
||||||
|
|
||||||
p4_check_commit_author usernamefile3 alice
|
p4_check_commit_author usernamefile3 alice
|
||||||
)
|
)
|
||||||
|
|
|
@ -141,7 +141,7 @@ test_expect_success 'detect copies' '
|
||||||
git diff-tree -r -C HEAD &&
|
git diff-tree -r -C HEAD &&
|
||||||
git p4 submit &&
|
git p4 submit &&
|
||||||
p4 filelog //depot/file8 &&
|
p4 filelog //depot/file8 &&
|
||||||
p4 filelog //depot/file8 | test_must_fail grep -q "branch from" &&
|
! p4 filelog //depot/file8 | grep -q "branch from" &&
|
||||||
|
|
||||||
echo "file9" >>file2 &&
|
echo "file9" >>file2 &&
|
||||||
git commit -a -m "Differentiate file2" &&
|
git commit -a -m "Differentiate file2" &&
|
||||||
|
@ -154,7 +154,7 @@ test_expect_success 'detect copies' '
|
||||||
git config git-p4.detectCopies true &&
|
git config git-p4.detectCopies true &&
|
||||||
git p4 submit &&
|
git p4 submit &&
|
||||||
p4 filelog //depot/file9 &&
|
p4 filelog //depot/file9 &&
|
||||||
p4 filelog //depot/file9 | test_must_fail grep -q "branch from" &&
|
! p4 filelog //depot/file9 | grep -q "branch from" &&
|
||||||
|
|
||||||
echo "file10" >>file2 &&
|
echo "file10" >>file2 &&
|
||||||
git commit -a -m "Differentiate file2" &&
|
git commit -a -m "Differentiate file2" &&
|
||||||
|
@ -202,7 +202,7 @@ test_expect_success 'detect copies' '
|
||||||
git config git-p4.detectCopies $(($level + 2)) &&
|
git config git-p4.detectCopies $(($level + 2)) &&
|
||||||
git p4 submit &&
|
git p4 submit &&
|
||||||
p4 filelog //depot/file12 &&
|
p4 filelog //depot/file12 &&
|
||||||
p4 filelog //depot/file12 | test_must_fail grep -q "branch from" &&
|
! p4 filelog //depot/file12 | grep -q "branch from" &&
|
||||||
|
|
||||||
echo "file13" >>file2 &&
|
echo "file13" >>file2 &&
|
||||||
git commit -a -m "Differentiate file2" &&
|
git commit -a -m "Differentiate file2" &&
|
||||||
|
|
Loading…
Reference in a new issue