summaryrefslogtreecommitdiff
path: root/morphlib
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2014-12-03 14:39:57 +0000
committerSam Thursfield <sam.thursfield@codethink.co.uk>2014-12-04 15:47:00 +0000
commit39f708721adee1539e503f6cb2035f70288367e9 (patch)
tree0e77a7153b9e25f4e662d2576e4b738265d80b39 /morphlib
parent51d09cb0b24c0a3f1dd5526254e6dad4adfe11c0 (diff)
downloadmorph-39f708721adee1539e503f6cb2035f70288367e9.tar.gz
Gracefully handle Git repos in system branches with missing config
Previously if there were repos present in the system branch that weren't put there with `morph edit` or had lost their Morph-specific configuration entries somehow you might see this error: ERROR: Command failed: git config -z morph.repository
Diffstat (limited to 'morphlib')
-rw-r--r--morphlib/sysbranchdir.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/morphlib/sysbranchdir.py b/morphlib/sysbranchdir.py
index 4351c6b3..4dbc5f6c 100644
--- a/morphlib/sysbranchdir.py
+++ b/morphlib/sysbranchdir.py
@@ -72,7 +72,11 @@ class SystemBranchDirectory(object):
def _find_git_directory(self, repo_url):
for gd in self.list_git_directories():
- if gd.get_config('morph.repository') == repo_url:
+ try:
+ gd_repo_url = gd.get_config('morph.repository')
+ except cliapp.AppException: # pragma: no cover
+ continue
+ if gd_repo_url == repo_url:
return gd.dirname
return None