Fixed "heads/" prepend problem for plugin upload #4695

This commit is contained in:
Nick Bolton 2015-05-26 16:56:21 +01:00
parent d6cefa73a0
commit efd0108597
1 changed files with 7 additions and 5 deletions

View File

@ -972,7 +972,13 @@ class InternalCommands:
if p.returncode != 0: if p.returncode != 0:
raise Exception('Could not get branch name, git error: ' + str(p.returncode)) 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): def find_revision_svn(self):
if sys.version_info < (2, 4): if sys.version_info < (2, 4):
@ -1443,10 +1449,6 @@ class InternalCommands:
branch = self.getGitBranchName() branch = self.getGitBranchName()
revision = self.getGitRevision() 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) # find the version number (we're puting the rev in after this)
pattern = '(\d+\.\d+\.\d+)' pattern = '(\d+\.\d+\.\d+)'
replace = "%s-%s" % (branch, revision) replace = "%s-%s" % (branch, revision)