Use os.path.join for git driver getGitUrl
The current code uses a format string with an unconditional injection of a /. This can result in a double-slash which can then cause git to be unable to clone things. That in turn can lead to an indefinite hang of a job trying to use the repo from the git driver. Replace the format string with os.path.join which will correctly join the project to the baseurl whether it's a url or a bare path, and whether or not it has a trailing slash. Change-Id: Id0e529b916ff75d6b6df98d978d2349f6037499c
This commit is contained in:
parent
a5d6edbae7
commit
1779565108
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
fixes:
|
||||
- |
|
||||
Fixed an issue where a trailing slash on the baseurl of a git driver
|
||||
connection config could cause an indefinite job hang.
|
|
@ -231,8 +231,7 @@ class GitConnection(BaseConnection):
|
|||
return branches
|
||||
|
||||
def getGitUrl(self, project):
|
||||
url = '%s/%s' % (self.baseurl, project.name)
|
||||
return url
|
||||
return os.path.join(self.baseurl, project.name)
|
||||
|
||||
def onLoad(self):
|
||||
self.log.debug("Starting Git Watcher")
|
||||
|
|
Loading…
Reference in New Issue