From 7cc01d8c68853344a58028446aec315a97e65a9f Mon Sep 17 00:00:00 2001 From: Ben Brown Date: Mon, 4 Apr 2016 20:13:42 +0000 Subject: 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 --- morphlib/gitdir.py | 6 +++--- 1 file 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 -- cgit v1.2.1