summaryrefslogtreecommitdiffstats
path: root/manifest_xml.py
diff options
context:
space:
mode:
authorLaMont Jones <lamontjones@google.com>2022-08-22 19:26:14 +0000
committerLaMont Jones <lamontjones@google.com>2022-08-22 21:49:49 +0000
commitfbd5dd3a304e53bb795515d2f8e53001b7080949 (patch)
tree61dc0bf115be3d8b96b408b9ba5276a1fe884506 /manifest_xml.py
parent3d27c71dd928bd345257055cdf2a6be8f8a09bed (diff)
downloadgit-repo-fbd5dd3a304e53bb795515d2f8e53001b7080949.tar.gz
manifest_xml: improve topdir accuracy.v2.29
Do not include a trailing path separator when submanifest_path is empty. Bug: https://crbug.com/gerrit/16104 Change-Id: Ia65e355de25bdb1067fe50ab1d47db6e798d5a71 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/343674 Tested-by: LaMont Jones <lamontjones@google.com> Reviewed-by: Mike Frysinger <vapier@google.com>
Diffstat (limited to 'manifest_xml.py')
-rw-r--r--manifest_xml.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/manifest_xml.py b/manifest_xml.py
index 84be8f4a..ea274c76 100644
--- a/manifest_xml.py
+++ b/manifest_xml.py
@@ -358,7 +358,10 @@ class XmlManifest(object):
358 358
359 self.repodir = os.path.abspath(repodir) 359 self.repodir = os.path.abspath(repodir)
360 self._CheckLocalPath(submanifest_path) 360 self._CheckLocalPath(submanifest_path)
361 self.topdir = os.path.join(os.path.dirname(self.repodir), submanifest_path) 361 self.topdir = os.path.dirname(self.repodir)
362 if submanifest_path:
363 # This avoids a trailing os.path.sep when submanifest_path is empty.
364 self.topdir = os.path.join(self.topdir, submanifest_path)
362 if manifest_file != os.path.abspath(manifest_file): 365 if manifest_file != os.path.abspath(manifest_file):
363 raise ManifestParseError('manifest_file must be abspath') 366 raise ManifestParseError('manifest_file must be abspath')
364 self.manifestFile = manifest_file 367 self.manifestFile = manifest_file