summaryrefslogtreecommitdiff
path: root/tests.branching/init-existing.script
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/init-existing.script
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/init-existing.script')
-rwxr-xr-xtests.branching/init-existing.script6
1 files changed, 3 insertions, 3 deletions
diff --git a/tests.branching/init-existing.script b/tests.branching/init-existing.script
index b4031082..e713b9df 100755
--- a/tests.branching/init-existing.script
+++ b/tests.branching/init-existing.script
@@ -1,15 +1,15 @@
#!/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.