From dc60e54d361863aa50440b2f4fd6d29dc51794b4 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Fri, 11 Dec 2020 04:02:19 -0500 Subject: [PATCH] gitc: write the manifest directly Rather than pull the client dir out to construct the manifest filename which the manifest itself already has, pull the filename out and use that. Change-Id: I33991084dcb3205f819bb841084e3c48d6ccb284 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/291264 Reviewed-by: Jonathan Nieder Tested-by: Mike Frysinger --- gitc_utils.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gitc_utils.py b/gitc_utils.py index 8ff7699b..6354702f 100644 --- a/gitc_utils.py +++ b/gitc_utils.py @@ -157,8 +157,10 @@ def save_manifest(manifest, client_dir=None): client_dir: Client directory to save the manifest in. """ if not client_dir: - client_dir = manifest.gitc_client_dir - with open(os.path.join(client_dir, '.manifest'), 'w') as f: + manifest_file = manifest.manifestFile + else: + manifest_file = os.path.join(client_dir, '.manifest') + with open(manifest_file, 'w') as f: manifest.Save(f, groups=_manifest_groups(manifest)) # TODO(sbasi/jorg): Come up with a solution to remove the sleep below. # Give the GITC filesystem time to register the manifest changes.