t: introduce WITH_BREAKING_CHANGES prerequisite
Earlier c5bc9a7f (Makefile: wire up build option for deprecated
features, 2025-01-22) made an unfortunate decision to introduce the
WITHOUT_BREAKING_CHANGES prerequisite to perform tests that ensure
the historical behaviour that may be different from what we will
have in the future. It would inevitably invite double-negation when
we need to add tests to ensure the behaviour we want to have in the
future.
Introduce WITH_BREAKING_CHANGES prerequisite and replace the
existing uses of WITHOUT_BREAKING_CHANGES prerequisite. To catch
any future topics that add more uses of WITHOUT_BREAKING_CHANGES,
mark it as a removed prerequisite.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
@@ -36,7 +36,7 @@ relationship between packs and objects is as follows:
|
|||||||
|
|
||||||
. ./test-lib.sh
|
. ./test-lib.sh
|
||||||
|
|
||||||
if ! test_have_prereq WITHOUT_BREAKING_CHANGES
|
if test_have_prereq WITH_BREAKING_CHANGES
|
||||||
then
|
then
|
||||||
skip_all='skipping git-pack-redundant tests; built with breaking changes'
|
skip_all='skipping git-pack-redundant tests; built with breaking changes'
|
||||||
test_done
|
test_done
|
||||||
|
|||||||
@@ -1123,7 +1123,7 @@ Pull: refs/heads/main:refs/heads/origin
|
|||||||
Pull: refs/heads/next:refs/heads/origin2
|
Pull: refs/heads/next:refs/heads/origin2
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
test_expect_success WITHOUT_BREAKING_CHANGES 'migrate a remote from named file in $GIT_DIR/remotes' '
|
test_expect_success !WITH_BREAKING_CHANGES 'migrate a remote from named file in $GIT_DIR/remotes' '
|
||||||
git clone one five &&
|
git clone one five &&
|
||||||
origin_url=$(pwd)/one &&
|
origin_url=$(pwd)/one &&
|
||||||
(
|
(
|
||||||
@@ -1149,7 +1149,7 @@ test_expect_success WITHOUT_BREAKING_CHANGES 'migrate a remote from named file i
|
|||||||
)
|
)
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success WITHOUT_BREAKING_CHANGES 'migrate a remote from named file in $GIT_DIR/branches' '
|
test_expect_success !WITH_BREAKING_CHANGES 'migrate a remote from named file in $GIT_DIR/branches' '
|
||||||
git clone --template= one six &&
|
git clone --template= one six &&
|
||||||
origin_url=$(pwd)/one &&
|
origin_url=$(pwd)/one &&
|
||||||
(
|
(
|
||||||
@@ -1165,7 +1165,7 @@ test_expect_success WITHOUT_BREAKING_CHANGES 'migrate a remote from named file i
|
|||||||
)
|
)
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success WITHOUT_BREAKING_CHANGES 'migrate a remote from named file in $GIT_DIR/branches (2)' '
|
test_expect_success !WITH_BREAKING_CHANGES 'migrate a remote from named file in $GIT_DIR/branches (2)' '
|
||||||
git clone --template= one seven &&
|
git clone --template= one seven &&
|
||||||
(
|
(
|
||||||
cd seven &&
|
cd seven &&
|
||||||
|
|||||||
@@ -104,7 +104,7 @@ test_expect_success setup '
|
|||||||
git config remote.config-glob.fetch refs/heads/*:refs/remotes/rem/* &&
|
git config remote.config-glob.fetch refs/heads/*:refs/remotes/rem/* &&
|
||||||
remotes="$remotes config-glob" &&
|
remotes="$remotes config-glob" &&
|
||||||
|
|
||||||
if test_have_prereq WITHOUT_BREAKING_CHANGES
|
if ! test_have_prereq WITH_BREAKING_CHANGES
|
||||||
then
|
then
|
||||||
mkdir -p .git/remotes &&
|
mkdir -p .git/remotes &&
|
||||||
cat >.git/remotes/remote-explicit <<-\EOF &&
|
cat >.git/remotes/remote-explicit <<-\EOF &&
|
||||||
|
|||||||
@@ -975,7 +975,7 @@ test_expect_success 'allow push to HEAD of non-bare repository (config)' '
|
|||||||
! grep "warning: updating the current branch" stderr
|
! grep "warning: updating the current branch" stderr
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success WITHOUT_BREAKING_CHANGES 'fetch with branches' '
|
test_expect_success !WITH_BREAKING_CHANGES 'fetch with branches' '
|
||||||
mk_empty testrepo &&
|
mk_empty testrepo &&
|
||||||
git branch second $the_first_commit &&
|
git branch second $the_first_commit &&
|
||||||
git checkout second &&
|
git checkout second &&
|
||||||
@@ -991,7 +991,7 @@ test_expect_success WITHOUT_BREAKING_CHANGES 'fetch with branches' '
|
|||||||
git checkout main
|
git checkout main
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success WITHOUT_BREAKING_CHANGES 'fetch with branches containing #' '
|
test_expect_success !WITH_BREAKING_CHANGES 'fetch with branches containing #' '
|
||||||
mk_empty testrepo &&
|
mk_empty testrepo &&
|
||||||
mkdir testrepo/.git/branches &&
|
mkdir testrepo/.git/branches &&
|
||||||
echo "..#second" > testrepo/.git/branches/branch2 &&
|
echo "..#second" > testrepo/.git/branches/branch2 &&
|
||||||
@@ -1005,7 +1005,7 @@ test_expect_success WITHOUT_BREAKING_CHANGES 'fetch with branches containing #'
|
|||||||
git checkout main
|
git checkout main
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success WITHOUT_BREAKING_CHANGES 'push with branches' '
|
test_expect_success !WITH_BREAKING_CHANGES 'push with branches' '
|
||||||
mk_empty testrepo &&
|
mk_empty testrepo &&
|
||||||
git checkout second &&
|
git checkout second &&
|
||||||
|
|
||||||
@@ -1022,7 +1022,7 @@ test_expect_success WITHOUT_BREAKING_CHANGES 'push with branches' '
|
|||||||
)
|
)
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success WITHOUT_BREAKING_CHANGES 'push with branches containing #' '
|
test_expect_success !WITH_BREAKING_CHANGES 'push with branches containing #' '
|
||||||
mk_empty testrepo &&
|
mk_empty testrepo &&
|
||||||
|
|
||||||
test_when_finished "rm -rf .git/branches" &&
|
test_when_finished "rm -rf .git/branches" &&
|
||||||
|
|||||||
@@ -1862,8 +1862,13 @@ test_lazy_prereq CURL '
|
|||||||
curl --version
|
curl --version
|
||||||
'
|
'
|
||||||
|
|
||||||
|
test_lazy_prereq WITH_BREAKING_CHANGES '
|
||||||
|
test -n "$WITH_BREAKING_CHANGES"
|
||||||
|
'
|
||||||
|
|
||||||
test_lazy_prereq WITHOUT_BREAKING_CHANGES '
|
test_lazy_prereq WITHOUT_BREAKING_CHANGES '
|
||||||
test -z "$WITH_BREAKING_CHANGES"
|
# Signal that this prereq should not be used.
|
||||||
|
exit 125
|
||||||
'
|
'
|
||||||
|
|
||||||
# SHA1 is a test if the hash algorithm in use is SHA-1. This is both for tests
|
# SHA1 is a test if the hash algorithm in use is SHA-1. This is both for tests
|
||||||
|
|||||||
Reference in New Issue
Block a user