summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xt/t3201-branch-contains.sh47
1 files changed, 36 insertions, 11 deletions
diff --git a/t/t3201-branch-contains.sh b/t/t3201-branch-contains.sh
index 40251c9f8f..3cb9dc6cca 100755
--- a/t/t3201-branch-contains.sh
+++ b/t/t3201-branch-contains.sh
@@ -171,6 +171,42 @@ test_expect_success 'Assert that --contains only works on commits, not trees & b
test_must_fail git branch --no-contains $blob
'
+test_expect_success 'multiple branch --contains' '
+ git checkout -b side2 master &&
+ >feature &&
+ git add feature &&
+ git commit -m "add feature" &&
+ git checkout -b next master &&
+ git merge side &&
+ git branch --contains side --contains side2 >actual &&
+ cat >expect <<-\EOF &&
+ * next
+ side
+ side2
+ EOF
+ test_cmp expect actual
+'
+
+test_expect_success 'multiple branch --no-contains' '
+ git branch --no-contains side --no-contains side2 >actual &&
+ cat >expect <<-\EOF &&
+ master
+ EOF
+ test_cmp expect actual
+'
+
+test_expect_success 'branch --contains combined with --no-contains' '
+ git checkout -b seen master &&
+ git merge side &&
+ git merge side2 &&
+ git branch --contains side --no-contains side2 >actual &&
+ cat >expect <<-\EOF &&
+ next
+ side
+ EOF
+ test_cmp expect actual
+'
+
# We want to set up a case where the walk for the tracking info
# of one branch crosses the tip of another branch (and make sure
# that the latter walk does not mess up our flag to see if it was
@@ -200,15 +236,4 @@ test_expect_success 'branch --merged with --verbose' '
test_i18ncmp expect actual
'
-test_expect_success 'branch --contains combined with --no-contains' '
- git branch --contains zzz --no-contains topic >actual &&
- cat >expect <<-\EOF &&
- master
- side
- zzz
- EOF
- test_cmp expect actual
-
-'
-
test_done