git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cleanup merge-base test script
@ 2007-06-26 23:44 Sam Vilain
  0 siblings, 0 replies; only message in thread
From: Sam Vilain @ 2007-06-26 23:44 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git, Sam Vilain

Add a picture, and keep the setup and the tests together.

Signed-off-by: Sam Vilain <sam.vilain@catalyst.net.nz>
---
 t/t6010-merge-base.sh |   30 ++++++++++++++++++------------
 1 files changed, 18 insertions(+), 12 deletions(-)

diff --git a/t/t6010-merge-base.sh b/t/t6010-merge-base.sh
index b15920b..22e0893 100755
--- a/t/t6010-merge-base.sh
+++ b/t/t6010-merge-base.sh
@@ -34,6 +34,12 @@ doit() {
 	echo $commit
 }
 
+#  E---D---C---B---A
+#  \'-_         \   \
+#   \  `---------G   \
+#    \                \
+#     F----------------H
+
 # Setup...
 E=$(doit 5 E)
 D=$(doit 4 D $E)
@@ -44,6 +50,18 @@ A=$(doit 1 A $B)
 G=$(doit 7 G $B $E)
 H=$(doit 8 H $A $F)
 
+test_expect_success 'compute merge-base (single)' \
+    'MB=$(git-merge-base G H) &&
+     expr "$(git-name-rev "$MB")" : "[0-9a-f]* tags/B"'
+
+test_expect_success 'compute merge-base (all)' \
+    'MB=$(git-merge-base --all G H) &&
+     expr "$(git-name-rev "$MB")" : "[0-9a-f]* tags/B"'
+
+test_expect_success 'compute merge-base with show-branch' \
+    'MB=$(git-show-branch --merge-base G H) &&
+     expr "$(git-name-rev "$MB")" : "[0-9a-f]* tags/B"'
+
 # Setup for second test to demonstrate that relying on timestamps in a
 # distributed SCM to provide a _consistent_ partial ordering of commits
 # leads to insanity.
@@ -82,18 +100,6 @@ PL=$(doit  4 PL $L2 $C2)
 PR=$(doit  4 PR $C2 $R2)
 
 test_expect_success 'compute merge-base (single)' \
-    'MB=$(git-merge-base G H) &&
-     expr "$(git-name-rev "$MB")" : "[0-9a-f]* tags/B"'
-
-test_expect_success 'compute merge-base (all)' \
-    'MB=$(git-merge-base --all G H) &&
-     expr "$(git-name-rev "$MB")" : "[0-9a-f]* tags/B"'
-
-test_expect_success 'compute merge-base with show-branch' \
-    'MB=$(git-show-branch --merge-base G H) &&
-     expr "$(git-name-rev "$MB")" : "[0-9a-f]* tags/B"'
-
-test_expect_success 'compute merge-base (single)' \
     'MB=$(git-merge-base PL PR) &&
      expr "$(git-name-rev "$MB")" : "[0-9a-f]* tags/C2"'
 
-- 
1.5.2.1.1131.g3b90

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2007-06-26 23:44 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-06-26 23:44 [PATCH] cleanup merge-base test script Sam Vilain

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).