mirror of
https://github.com/scm-manager/scm-manager.git
synced 2025-11-10 23:45:44 +01:00
remove trailing slash from path
This commit is contained in:
@@ -44,6 +44,11 @@ def getName(path):
|
|||||||
length =- 1
|
length =- 1
|
||||||
return parts[length - 1]
|
return parts[length - 1]
|
||||||
|
|
||||||
|
def removeTrailingSlash(path):
|
||||||
|
if path.endswith('/'):
|
||||||
|
path = path[0:-1]
|
||||||
|
return path
|
||||||
|
|
||||||
def appendSubRepositoryNode(doc, parentNode, path, subRepositories):
|
def appendSubRepositoryNode(doc, parentNode, path, subRepositories):
|
||||||
if path in subRepositories:
|
if path in subRepositories:
|
||||||
subRepository = subRepositories[path]
|
subRepository = subRepositories[path]
|
||||||
@@ -55,7 +60,7 @@ def appendSubRepositoryNode(doc, parentNode, path, subRepositories):
|
|||||||
def createBasicFileNode(doc, parentNode, path, directory):
|
def createBasicFileNode(doc, parentNode, path, directory):
|
||||||
fileNode = createChildNode(doc, parentNode, 'file')
|
fileNode = createChildNode(doc, parentNode, 'file')
|
||||||
appendTextNode(doc, fileNode, 'name', getName(path))
|
appendTextNode(doc, fileNode, 'name', getName(path))
|
||||||
appendTextNode(doc, fileNode, 'path', path)
|
appendTextNode(doc, fileNode, 'path', removeTrailingSlash(path))
|
||||||
appendTextNode(doc, fileNode, 'directory', directory)
|
appendTextNode(doc, fileNode, 'directory', directory)
|
||||||
return fileNode
|
return fileNode
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user