diff options
author | Mike Frysinger <vapier@google.com> | 2020-02-19 22:36:26 -0500 |
---|---|---|
committer | David Pursehouse <dpursehouse@collab.net> | 2020-02-21 05:17:05 +0000 |
commit | d9254599f9bb47632313ecb90c5f281ceca5da3a (patch) | |
tree | 5c1bdb0815f5a027f0de194b488ba254719c7c11 /project.py | |
parent | 746e7f664e306e823a40cd95a127516aa522ed8f (diff) | |
download | git-repo-d9254599f9bb47632313ecb90c5f281ceca5da3a.tar.gz |
manifest/tests: get them passing under Windows
We also need to check more things in the manifest/project handlers,
and use platform_utils in a few places to address Windows behavior.
Drop Python 2.7 from Windows testing as it definitely doesn't work
and we won't be fixing it.
Change-Id: I83d00ee9f1612312bb3f7147cb9535fc61268245
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/256113
Tested-by: Mike Frysinger <vapier@google.com>
Reviewed-by: Jonathan Nieder <jrn@google.com>
Reviewed-by: David Pursehouse <dpursehouse@collab.net>
Diffstat (limited to 'project.py')
-rw-r--r-- | project.py | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -275,7 +275,12 @@ def _SafeExpandPath(base, subpath, skipfinal=False): | |||
275 | NB: We rely on a number of paths already being filtered out while parsing the | 275 | NB: We rely on a number of paths already being filtered out while parsing the |
276 | manifest. See the validation logic in manifest_xml.py for more details. | 276 | manifest. See the validation logic in manifest_xml.py for more details. |
277 | """ | 277 | """ |
278 | components = subpath.split(os.path.sep) | 278 | # Split up the path by its components. We can't use os.path.sep exclusively |
279 | # as some platforms (like Windows) will convert / to \ and that bypasses all | ||
280 | # our constructed logic here. Especially since manifest authors only use | ||
281 | # / in their paths. | ||
282 | resep = re.compile(r'[/%s]' % re.escape(os.path.sep)) | ||
283 | components = resep.split(subpath) | ||
279 | if skipfinal: | 284 | if skipfinal: |
280 | # Whether the caller handles the final component itself. | 285 | # Whether the caller handles the final component itself. |
281 | finalpart = components.pop() | 286 | finalpart = components.pop() |