summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Thursfield <sam.thursfield@codethink.co.uk>2014-12-03 14:38:31 +0000
committerSam Thursfield <sam.thursfield@codethink.co.uk>2014-12-04 15:47:00 +0000
commit51d09cb0b24c0a3f1dd5526254e6dad4adfe11c0 (patch)
treec2bb176e632a201a5c513d2abc187bdc5ec41f3e
parent0861a2054145b9558f108e0662b35061db2a19ec (diff)
downloadmorph-51d09cb0b24c0a3f1dd5526254e6dad4adfe11c0.tar.gz
Document that GitDirectory.get_config() can raise an exception
Also fix wrong indent.
-rw-r--r--morphlib/gitdir.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/morphlib/gitdir.py b/morphlib/gitdir.py
index ed71e422..4c3efbd3 100644
--- a/morphlib/gitdir.py
+++ b/morphlib/gitdir.py
@@ -485,11 +485,15 @@ class GitDirectory(object):
self._config[key] = value
def get_config(self, key):
- '''Return value for a git repository configuration variable.'''
+ '''Return value for a git repository configuration variable.
+
+ If the variable is unset, this will raise cliapp.AppException.
+
+ '''
if key not in self._config:
- value = morphlib.git.gitcmd(self._runcmd, 'config', '-z', key)
- self._config[key] = value.rstrip('\0')
+ value = morphlib.git.gitcmd(self._runcmd, 'config', '-z', key)
+ self._config[key] = value.rstrip('\0')
return self._config[key]
def get_remote(self, *args, **kwargs):