summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-03-26 14:43:51 +0100
committerLars Wirzenius <lars.wirzenius@codethink.co.uk>2012-03-26 14:43:51 +0100
commit0d202c2370201195d0ac5b930027a7fbcdc16cd5 (patch)
tree2911f69296c01aa4b135711a2dc7a8542ec2191d
parentf171b6b27ac8d3bb7235d409cb2510516cf66b8f (diff)
downloadmorph-0d202c2370201195d0ac5b930027a7fbcdc16cd5.tar.gz
Change "checkout existing branch" test to not check out master
Checking out another branch exposed a bunch of bugs.
-rw-r--r--tests.branching/branch-creates-new-system-branch.stdout7
-rwxr-xr-xtests.branching/edit-checkouts-existing-chunk.script14
-rw-r--r--tests.branching/edit-checkouts-existing-chunk.stdout3
-rw-r--r--tests.branching/edit-clones-chunk.stdout14
-rwxr-xr-xtests.branching/setup10
5 files changed, 34 insertions, 14 deletions
diff --git a/tests.branching/branch-creates-new-system-branch.stdout b/tests.branching/branch-creates-new-system-branch.stdout
index 53256da5..6a3a9b98 100644
--- a/tests.branching/branch-creates-new-system-branch.stdout
+++ b/tests.branching/branch-creates-new-system-branch.stdout
@@ -17,8 +17,11 @@ Current origin:
* remote origin
Fetch URL: file://TMP/morphs
Push URL: file://TMP/morphs
- HEAD branch: master
- Remote branch:
+ HEAD branch (remote HEAD is ambiguous, may be one of the following):
+ alfred
+ master
+ Remote branches:
+ alfred tracked
master tracked
Local branch configured for 'git pull':
master merges with remote master
diff --git a/tests.branching/edit-checkouts-existing-chunk.script b/tests.branching/edit-checkouts-existing-chunk.script
index 144a3b07..583f19e1 100755
--- a/tests.branching/edit-checkouts-existing-chunk.script
+++ b/tests.branching/edit-checkouts-existing-chunk.script
@@ -23,17 +23,17 @@ set -eu
# Checkout the master system branch.
cd "$DATADIR/mine"
"$SRCDIR/scripts/test-morph" init
-"$SRCDIR/scripts/test-morph" checkout master
+"$SRCDIR/scripts/test-morph" checkout alfred
-# Edit the hello chunk in master.
-cd master/morphs
-"$SRCDIR/scripts/test-morph" edit hello master
+# Edit the hello chunk in alfred.
+cd alfred/morphs
+"$SRCDIR/scripts/test-morph" edit hello alfred
echo "Current branches, morphs:"
-"$SRCDIR/scripts/run-git-in" "$DATADIR/mine/master/morphs" branch
+"$SRCDIR/scripts/run-git-in" "$DATADIR/mine/alfred/morphs" branch
echo "Current branches, hello:"
-"$SRCDIR/scripts/run-git-in" "$DATADIR/mine/master/hello" branch
+"$SRCDIR/scripts/run-git-in" "$DATADIR/mine/alfred/hello" branch
echo "Files in hello:"
-ls "$DATADIR/mine/master/hello"
+ls "$DATADIR/mine/alfred/hello"
diff --git a/tests.branching/edit-checkouts-existing-chunk.stdout b/tests.branching/edit-checkouts-existing-chunk.stdout
index 13122b91..a06832c2 100644
--- a/tests.branching/edit-checkouts-existing-chunk.stdout
+++ b/tests.branching/edit-checkouts-existing-chunk.stdout
@@ -1,6 +1,7 @@
Current branches, morphs:
* master
Current branches, hello:
-* master
+* alfred
+ master
Files in hello:
hello.chunk
diff --git a/tests.branching/edit-clones-chunk.stdout b/tests.branching/edit-clones-chunk.stdout
index a8659665..4bbf909e 100644
--- a/tests.branching/edit-clones-chunk.stdout
+++ b/tests.branching/edit-clones-chunk.stdout
@@ -5,8 +5,11 @@ Current origin, morphs:
* remote origin
Fetch URL: file://TMP/morphs
Push URL: file://TMP/morphs
- HEAD branch: master
- Remote branch:
+ HEAD branch (remote HEAD is ambiguous, may be one of the following):
+ alfred
+ master
+ Remote branches:
+ alfred tracked
master tracked
Local branch configured for 'git pull':
master merges with remote master
@@ -19,8 +22,11 @@ Current origin, hello:
* remote origin
Fetch URL: file://TMP/hello
Push URL: file://TMP/hello
- HEAD branch: master
- Remote branch:
+ HEAD branch (remote HEAD is ambiguous, may be one of the following):
+ alfred
+ master
+ Remote branches:
+ alfred tracked
master tracked
Local branch configured for 'git pull':
master merges with remote master
diff --git a/tests.branching/setup b/tests.branching/setup
index 791e0337..68117fa3 100755
--- a/tests.branching/setup
+++ b/tests.branching/setup
@@ -72,6 +72,11 @@ scripts/run-git-in "$DATADIR/morphs" add .
scripts/run-git-in "$DATADIR/morphs" commit -m initial
+# Add an extra branch to the morphs repo.
+scripts/run-git-in "$DATADIR/morphs" checkout -b alfred
+scripts/run-git-in "$DATADIR/morphs" checkout master
+
+
# Create a dummy chunk repository
mkdir "$DATADIR/hello"
@@ -87,3 +92,8 @@ scripts/run-git-in "$DATADIR/hello" init
scripts/run-git-in "$DATADIR/hello" add .
scripts/run-git-in "$DATADIR/hello" commit -m initial
+
+# Add an extra branch to the hello repo.
+scripts/run-git-in "$DATADIR/hello" checkout -b alfred
+scripts/run-git-in "$DATADIR/hello" checkout master
+