summaryrefslogtreecommitdiff
path: root/tests.branching/show-system-branch-fails-outside-workspace.exit
diff options
context:
space:
mode:
authorJannis Pohlmann <jannis.pohlmann@codethink.co.uk>2012-08-29 11:07:11 +0000
committerJannis Pohlmann <jannis.pohlmann@codethink.co.uk>2012-08-29 18:47:16 +0100
commit4018afbdb583517277a0f1f7d990fa4c2a04923a (patch)
tree625e63034b107c07a205d7077e0e0faec807d8b7 /tests.branching/show-system-branch-fails-outside-workspace.exit
parentb78ac0f72aa2fc4815131bb2bbd883a373c62e48 (diff)
downloadmorph-4018afbdb583517277a0f1f7d990fa4c2a04923a.tar.gz
Make "morph show-system-branch" anywhere in a workspace, if possible
There are mainly three situations to deal with: 1. We are outside a workspace and cannot deduce the system branch. 2. We are inside a workspace and inside a branch. We can detect this by walking up from the working directory towards the workspace. If we find a .morph-system-branch in one of the parent directories, we know the branch name. If we don't find one, something is wrong. 3. We are inside a workspace but outside a branch (or partially into a branch, e.g. in foo/ where the branch is foo/bar). We can deduce the branch if we recurse into subdirectories to find a .morph-system-branch directory. Care needs to be taken to not recurse infinitely. We may also not recurse if there are multiple subdirectories as these could belong to two different branches. This commit makes "morph show-system-branch" work in all of the above scenarios. It also adds tests for all of them.
Diffstat (limited to 'tests.branching/show-system-branch-fails-outside-workspace.exit')
-rw-r--r--tests.branching/show-system-branch-fails-outside-workspace.exit1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests.branching/show-system-branch-fails-outside-workspace.exit b/tests.branching/show-system-branch-fails-outside-workspace.exit
new file mode 100644
index 00000000..d00491fd
--- /dev/null
+++ b/tests.branching/show-system-branch-fails-outside-workspace.exit
@@ -0,0 +1 @@
+1