summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Brown <ben.brown@codethink.co.uk>2016-04-04 20:13:42 +0000
committerBen Brown <ben.brown@codethink.co.uk>2016-04-04 13:40:21 -0700
commit7cc01d8c68853344a58028446aec315a97e65a9f (patch)
tree5ed11e3823fdb84909edc540380eec85eab9cd44
parentd60562ddf12342efb11f4766895dfc254a06f220 (diff)
downloadmorph-7cc01d8c68853344a58028446aec315a97e65a9f.tar.gz
Convert the output of unpushed branch check to lower case
In commit 3a429d0 of git, the casing of certain error messages was changed, convert the message to lower case before comparison. ERROR: Command failed: git rev-parse --abbrev-ref benbrown/foo@{upstream} fatal: no upstream configured for branch 'benbrown/foo' Change-Id: I5e0659b69f3be84820592b7fe26e50203272da22
-rw-r--r--morphlib/gitdir.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/morphlib/gitdir.py b/morphlib/gitdir.py
index e2ea5f4d..f1286b25 100644
--- a/morphlib/gitdir.py
+++ b/morphlib/gitdir.py
@@ -609,15 +609,15 @@ class GitDirectory(object):
'%s@{upstream}' % branch).strip()
return out
except cliapp.AppException as e:
- emsg = str(e)
+ emsg = str(e).lower()
if 'does not point to a branch' in emsg:
# ref wasn't a branch, can't have upstream
# treat it the same as no upstream for convenience
return None
- elif 'No such branch' in emsg:
+ elif 'no such branch' in emsg:
# Same as above
return None
- elif 'No upstream configured for branch' in emsg:
+ elif 'no upstream configured for branch' in emsg:
return None
raise