diff options
author | Josip Sokcevic <sokcevic@chromium.org> | 2024-12-13 18:24:20 +0000 |
---|---|---|
committer | Josip Sokcevic <sokcevic@chromium.org> | 2024-12-16 10:23:40 -0800 |
commit | 9500aca754058bff18ddf35db62852ca4f722c63 (patch) | |
tree | a84d3c3423057959a48b1fff51d71681034a26c2 | |
parent | e8a7b9d5968ce0dbd548d875da4e6aaff6e5dda0 (diff) | |
download | git-repo-9500aca754058bff18ddf35db62852ca4f722c63.tar.gz |
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 <sokcevic@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
-rw-r--r-- | subcmds/sync.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/subcmds/sync.py b/subcmds/sync.py index 17c8b9bf..7c4c468a 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py | |||
@@ -1442,7 +1442,10 @@ later is required to fix a server side protocol bug. | |||
1442 | for need_remove_file in need_remove_files: | 1442 | for need_remove_file in need_remove_files: |
1443 | # Try to remove the updated copyfile or linkfile. | 1443 | # Try to remove the updated copyfile or linkfile. |
1444 | # So, if the file is not exist, nothing need to do. | 1444 | # 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 | ) | ||
1446 | 1449 | ||
1447 | # Create copy-link-files.json, save dest path of "copyfile" and | 1450 | # Create copy-link-files.json, save dest path of "copyfile" and |
1448 | # "linkfile". | 1451 | # "linkfile". |