From efd01085974da90ee297f12e228719dfdce774b2 Mon Sep 17 00:00:00 2001 From: Nick Bolton Date: Tue, 26 May 2015 16:56:21 +0100 Subject: [PATCH] Fixed "heads/" prepend problem for plugin upload #4695 --- ext/toolchain/commands1.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/ext/toolchain/commands1.py b/ext/toolchain/commands1.py index 777d7e98..1cec58cd 100644 --- a/ext/toolchain/commands1.py +++ b/ext/toolchain/commands1.py @@ -972,7 +972,13 @@ class InternalCommands: if p.returncode != 0: raise Exception('Could not get branch name, git error: ' + str(p.returncode)) - return stdout.strip() + result = stdout.strip() + + # sometimes, git will prepend "heads/" infront of the branch name, + # remove this as it's not useful to us and causes ftp issues. + result = re.sub("heads/", "", result) + + return result def find_revision_svn(self): if sys.version_info < (2, 4): @@ -1443,10 +1449,6 @@ class InternalCommands: branch = self.getGitBranchName() revision = self.getGitRevision() - # sometimes, git will prepend "heads/" infront of the branch name, - # remove this as it's not useful to us and causes ftp issues. - branch = re.sub("heads/", "", branch) - # find the version number (we're puting the rev in after this) pattern = '(\d+\.\d+\.\d+)' replace = "%s-%s" % (branch, revision)