Skip to content

Commit 926d18e

Browse files
committed
t: introduce WITH_BREAKING_CHANGES prerequisite
Earlier c5bc9a7 (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 <[email protected]>
1 parent 1c24d55 commit 926d18e

File tree

5 files changed

+15
-10
lines changed

5 files changed

+15
-10
lines changed

t/t5323-pack-redundant.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ relationship between packs and objects is as follows:
3636

3737
. ./test-lib.sh
3838

39-
if ! test_have_prereq WITHOUT_BREAKING_CHANGES
39+
if test_have_prereq WITH_BREAKING_CHANGES
4040
then
4141
skip_all='skipping git-pack-redundant tests; built with breaking changes'
4242
test_done

t/t5505-remote.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1123,7 +1123,7 @@ Pull: refs/heads/main:refs/heads/origin
11231123
Pull: refs/heads/next:refs/heads/origin2
11241124
EOF
11251125

1126-
test_expect_success WITHOUT_BREAKING_CHANGES 'migrate a remote from named file in $GIT_DIR/remotes' '
1126+
test_expect_success !WITH_BREAKING_CHANGES 'migrate a remote from named file in $GIT_DIR/remotes' '
11271127
git clone one five &&
11281128
origin_url=$(pwd)/one &&
11291129
(
@@ -1149,7 +1149,7 @@ test_expect_success WITHOUT_BREAKING_CHANGES 'migrate a remote from named file i
11491149
)
11501150
'
11511151

1152-
test_expect_success WITHOUT_BREAKING_CHANGES 'migrate a remote from named file in $GIT_DIR/branches' '
1152+
test_expect_success !WITH_BREAKING_CHANGES 'migrate a remote from named file in $GIT_DIR/branches' '
11531153
git clone --template= one six &&
11541154
origin_url=$(pwd)/one &&
11551155
(
@@ -1165,7 +1165,7 @@ test_expect_success WITHOUT_BREAKING_CHANGES 'migrate a remote from named file i
11651165
)
11661166
'
11671167

1168-
test_expect_success WITHOUT_BREAKING_CHANGES 'migrate a remote from named file in $GIT_DIR/branches (2)' '
1168+
test_expect_success !WITH_BREAKING_CHANGES 'migrate a remote from named file in $GIT_DIR/branches (2)' '
11691169
git clone --template= one seven &&
11701170
(
11711171
cd seven &&

t/t5515-fetch-merge-logic.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ test_expect_success setup '
104104
git config remote.config-glob.fetch refs/heads/*:refs/remotes/rem/* &&
105105
remotes="$remotes config-glob" &&
106106
107-
if test_have_prereq WITHOUT_BREAKING_CHANGES
107+
if ! test_have_prereq WITH_BREAKING_CHANGES
108108
then
109109
mkdir -p .git/remotes &&
110110
cat >.git/remotes/remote-explicit <<-\EOF &&

t/t5516-fetch-push.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -975,7 +975,7 @@ test_expect_success 'allow push to HEAD of non-bare repository (config)' '
975975
! grep "warning: updating the current branch" stderr
976976
'
977977

978-
test_expect_success WITHOUT_BREAKING_CHANGES 'fetch with branches' '
978+
test_expect_success !WITH_BREAKING_CHANGES 'fetch with branches' '
979979
mk_empty testrepo &&
980980
git branch second $the_first_commit &&
981981
git checkout second &&
@@ -991,7 +991,7 @@ test_expect_success WITHOUT_BREAKING_CHANGES 'fetch with branches' '
991991
git checkout main
992992
'
993993

994-
test_expect_success WITHOUT_BREAKING_CHANGES 'fetch with branches containing #' '
994+
test_expect_success !WITH_BREAKING_CHANGES 'fetch with branches containing #' '
995995
mk_empty testrepo &&
996996
mkdir testrepo/.git/branches &&
997997
echo "..#second" > testrepo/.git/branches/branch2 &&
@@ -1005,7 +1005,7 @@ test_expect_success WITHOUT_BREAKING_CHANGES 'fetch with branches containing #'
10051005
git checkout main
10061006
'
10071007

1008-
test_expect_success WITHOUT_BREAKING_CHANGES 'push with branches' '
1008+
test_expect_success !WITH_BREAKING_CHANGES 'push with branches' '
10091009
mk_empty testrepo &&
10101010
git checkout second &&
10111011
@@ -1022,7 +1022,7 @@ test_expect_success WITHOUT_BREAKING_CHANGES 'push with branches' '
10221022
)
10231023
'
10241024

1025-
test_expect_success WITHOUT_BREAKING_CHANGES 'push with branches containing #' '
1025+
test_expect_success !WITH_BREAKING_CHANGES 'push with branches containing #' '
10261026
mk_empty testrepo &&
10271027
10281028
test_when_finished "rm -rf .git/branches" &&

t/test-lib.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1862,8 +1862,13 @@ test_lazy_prereq CURL '
18621862
curl --version
18631863
'
18641864

1865+
test_lazy_prereq WITH_BREAKING_CHANGES '
1866+
test -n "$WITH_BREAKING_CHANGES"
1867+
'
1868+
18651869
test_lazy_prereq WITHOUT_BREAKING_CHANGES '
1866-
test -z "$WITH_BREAKING_CHANGES"
1870+
# Signal that this prereq should not be used.
1871+
exit 125
18671872
'
18681873

18691874
# SHA1 is a test if the hash algorithm in use is SHA-1. This is both for tests

0 commit comments

Comments
 (0)