Skip to content

Commit 9500aca

Browse files
committed
sync: Delete symlinks relative to client topdir
If repo sync is invoked outside the repo root, and the latest manifest removes symlinks, repo incorrectly tries to remove symlink - it starts from `cwd` instead of the repo root. Bug: b/113935847 Bug: 40010423 Change-Id: Ia50ea70a376e38c94389880f020c80da3c3f453c Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/445901 Tested-by: Josip Sokcevic <[email protected]> Reviewed-by: Gavin Mak <[email protected]>
1 parent e8a7b9d commit 9500aca

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

subcmds/sync.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -1442,7 +1442,10 @@ def UpdateCopyLinkfileList(self, manifest):
14421442
for need_remove_file in need_remove_files:
14431443
# Try to remove the updated copyfile or linkfile.
14441444
# So, if the file is not exist, nothing need to do.
1445-
platform_utils.remove(need_remove_file, missing_ok=True)
1445+
platform_utils.remove(
1446+
os.path.join(self.client.topdir, need_remove_file),
1447+
missing_ok=True,
1448+
)
14461449

14471450
# Create copy-link-files.json, save dest path of "copyfile" and
14481451
# "linkfile".

0 commit comments

Comments
 (0)