From 39f708721adee1539e503f6cb2035f70288367e9 Mon Sep 17 00:00:00 2001 From: Sam Thursfield Date: Wed, 3 Dec 2014 14:39:57 +0000 Subject: 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 --- morphlib/sysbranchdir.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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 -- cgit v1.2.1