mirror of
https://github.com/facebook/sapling.git
synced 2024-10-07 15:27:13 +03:00
util: canonpath: simplify logic
if root == os.sep, then endswithsep(root) is True as well: one test is enough
This commit is contained in:
parent
a1609c7698
commit
6adbb3c99f
@ -266,9 +266,7 @@ def pathto(root, n1, n2):
|
||||
|
||||
def canonpath(root, cwd, myname):
|
||||
"""return the canonical path of myname, given cwd and root"""
|
||||
if root == os.sep:
|
||||
rootsep = os.sep
|
||||
elif endswithsep(root):
|
||||
if endswithsep(root):
|
||||
rootsep = root
|
||||
else:
|
||||
rootsep = root + os.sep
|
||||
|
Loading…
Reference in New Issue
Block a user