Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>2021-01-23 16:00:42 +0300
committerJunio C Hamano <gitster@pobox.com>2021-01-24 00:25:12 +0300
commitf918a89e50d4e31fe5b2db979122e76992951bc7 (patch)
tree1b820d6c8e1813b1ca7368f070308f503d4a9796 /t/t9151-svn-mergeinfo.sh
parent4669917e8f20c047974ee162c5ec3b28bb6016c3 (diff)
git svn mergeinfo tests: refactor "test -z" to use test_must_be_empty
Refactor some old-style test code to use test_must_be_empty instead of "test -z". This makes a follow-up commit easier to read. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t9151-svn-mergeinfo.sh')
-rwxr-xr-xt/t9151-svn-mergeinfo.sh31
1 files changed, 16 insertions, 15 deletions
diff --git a/t/t9151-svn-mergeinfo.sh b/t/t9151-svn-mergeinfo.sh
index 59c5847c5f..806eff4023 100755
--- a/t/t9151-svn-mergeinfo.sh
+++ b/t/t9151-svn-mergeinfo.sh
@@ -17,41 +17,42 @@ test_expect_success 'load svn dump' "
"
test_expect_success 'all svn merges became git merge commits' '
- unmarked=$(git rev-list --parents --all --grep=Merge |
- grep -v " .* " | cut -f1 -d" ") &&
- [ -z "$unmarked" ]
+ git rev-list --parents --all --grep=Merge |
+ grep -v " .* " | cut -f1 -d" " >unmarked &&
+ test_must_be_empty unmarked
'
+
test_expect_success 'cherry picks did not become git merge commits' '
- bad_cherries=$(git rev-list --parents --all --grep=Cherry |
- grep " .* " | cut -f1 -d" ") &&
- [ -z "$bad_cherries" ]
+ git rev-list --parents --all --grep=Cherry |
+ grep " .* " | cut -f1 -d" " >bad-cherries &&
+ test_must_be_empty bad-cherries
'
test_expect_success 'svn non-merge merge commits did not become git merge commits' '
- bad_non_merges=$(git rev-list --parents --all --grep=non-merge |
- grep " .* " | cut -f1 -d" ") &&
- [ -z "$bad_non_merges" ]
+ git rev-list --parents --all --grep=non-merge |
+ grep " .* " | cut -f1 -d" " >bad-non-merges &&
+ test_must_be_empty bad-non-merges
'
test_expect_success 'commit made to merged branch is reachable from the merge' '
before_commit=$(git rev-list --all --grep="trunk commit before merging trunk to b2") &&
merge_commit=$(git rev-list --all --grep="Merge trunk to b2") &&
- not_reachable=$(git rev-list -1 $before_commit --not $merge_commit) &&
- [ -z "$not_reachable" ]
+ git rev-list -1 $before_commit --not $merge_commit >not-reachable &&
+ test_must_be_empty not-reachable
'
test_expect_success 'merging two branches in one commit is detected correctly' '
f1_commit=$(git rev-list --all --grep="make f1 branch from trunk") &&
f2_commit=$(git rev-list --all --grep="make f2 branch from trunk") &&
merge_commit=$(git rev-list --all --grep="Merge f1 and f2 to trunk") &&
- not_reachable=$(git rev-list -1 $f1_commit $f2_commit --not $merge_commit) &&
- [ -z "$not_reachable" ]
+ git rev-list -1 $f1_commit $f2_commit --not $merge_commit >not-reachable &&
+ test_must_be_empty not-reachable
'
test_expect_failure 'everything got merged in the end' '
- unmerged=$(git rev-list --all --not master) &&
- [ -z "$unmerged" ]
+ git rev-list --all --not master >unmerged &&
+ test_must_be_empty unmerged
'
test_done