diff options
author | Jannis Pohlmann <jannis.pohlmann@codethink.co.uk> | 2012-08-31 16:24:54 +0000 |
---|---|---|
committer | Sam Thursfield <sam.thursfield@codethink.co.uk> | 2012-09-03 14:33:21 +0100 |
commit | f9718b4dcc172763c1dd46bc805b6bde03ec3706 (patch) | |
tree | 660f028b882d3b6e8b28905b374848e5b81c41bf /tests.branching | |
parent | ff9325753f4fc1a2d060e9e65edd53fbc418e7c3 (diff) | |
download | morph-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')
-rwxr-xr-x | tests.branching/edit-works-after-branch-root-was-renamed.script | 34 | ||||
-rw-r--r-- | tests.branching/edit-works-after-branch-root-was-renamed.stdout | 18 |
2 files changed, 52 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_,' diff --git a/tests.branching/edit-works-after-branch-root-was-renamed.stdout b/tests.branching/edit-works-after-branch-root-was-renamed.stdout new file mode 100644 index 00000000..5554e08b --- /dev/null +++ b/tests.branching/edit-works-after-branch-root-was-renamed.stdout @@ -0,0 +1,18 @@ +d . +d ./.morph +d ./.morph/cache +d ./.morph/cache/gits +d ./.morph/cache/gits/file_hello +d ./.morph/cache/gits/file_hello/.git +d ./.morph/cache/gits/file_morphs +d ./.morph/cache/gits/file_morphs/.git +d ./master +d ./master/.morph-system-branch +d ./master/baserock:hello +d ./master/baserock:hello/.git +d ./master/my-renamed-morphs +d ./master/my-renamed-morphs/.git +f ./master/.morph-system-branch/branch-root +f ./master/baserock:hello/hello.morph +f ./master/my-renamed-morphs/hello-stratum.morph +f ./master/my-renamed-morphs/hello-system.morph |