summaryrefslogtreecommitdiff
path: root/tests.branching/edit-works-after-branch-root-was-renamed.script
diff options
context:
space:
mode:
authorJannis Pohlmann <jannis.pohlmann@codethink.co.uk>2012-08-31 16:24:54 +0000
committerSam Thursfield <sam.thursfield@codethink.co.uk>2012-09-03 14:33:21 +0100
commitf9718b4dcc172763c1dd46bc805b6bde03ec3706 (patch)
tree660f028b882d3b6e8b28905b374848e5b81c41bf /tests.branching/edit-works-after-branch-root-was-renamed.script
parentff9325753f4fc1a2d060e9e65edd53fbc418e7c3 (diff)
downloadmorph-f9718b4dcc172763c1dd46bc805b6bde03ec3706.tar.gz
Find branch root using the morph.repository option in .git/config
This is more flexible than relying on the branch root repository directory to have the original name. The user might rename the branch root directory and we still want to be able to find it. Add a test that this new functionality works.
Diffstat (limited to 'tests.branching/edit-works-after-branch-root-was-renamed.script')
-rwxr-xr-xtests.branching/edit-works-after-branch-root-was-renamed.script34
1 files changed, 34 insertions, 0 deletions
diff --git a/tests.branching/edit-works-after-branch-root-was-renamed.script b/tests.branching/edit-works-after-branch-root-was-renamed.script
new file mode 100755
index 00000000..da8fb0b7
--- /dev/null
+++ b/tests.branching/edit-works-after-branch-root-was-renamed.script
@@ -0,0 +1,34 @@
+#!/bin/sh
+# Copyright (C) 2012 Codethink Limited
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; version 2 of the License.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+
+# Verify that the branch root repository created by "morph branch" or
+# "morph checkout" can be renamed and "morph edit" still finds the
+# branch root repo and works.
+
+set -eu
+
+cd "$DATADIR/workspace"
+
+"$SRCDIR/scripts/test-morph" init
+"$SRCDIR/scripts/test-morph" checkout baserock:morphs master
+
+cd "$DATADIR/workspace/master"
+mv baserock:morphs my-renamed-morphs
+
+"$SRCDIR/scripts/test-morph" edit baserock:hello master
+
+"$SRCDIR/scripts/list-tree" "$DATADIR/workspace" | grep -v '/\.git/' |
+ sed 's,/cache/gits/file_[^/]*_,/cache/gits/file_,'