mirror of
https://gerrit.googlesource.com/git-repo
synced 2026-05-30 06:29:52 +00:00
sync: Skip copyfile/linkfile for unavailable projects
Commit 5534f16 made UpdateCopyLinkfileList to retry _CopyAndLinkFiles
for all projects in the manifest to handle directory-to-symlink
transistions. However, for partial sync's (e.g. repo sync <project>),
projects not included in the sync may not have their local directories
populated, attempts to perform the operation on unavailable projects
would result in dangling symlinks, or errors like:
error: Cannot copy file <source> to <destination>
Fix this by adding a check inside _CopyAndLinkFiles in project.py to
so these operations happen only when the project's worktree exists
and is a directory.
TAG=agy
CONV=90f5fca7-2199-4017-8f62-a010b0ab1dbf
Change-Id: I9ae1e8d62d8fd129cb4535e574c38339c87af441
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/587501
Reviewed-by: Mike Frysinger <vapier@google.com>
Tested-by: Xin Li <delphij@google.com>
This commit is contained in:
@@ -1575,6 +1575,8 @@ class Project:
|
||||
self._InitHooks()
|
||||
|
||||
def _CopyAndLinkFiles(self):
|
||||
if not self.worktree or not platform_utils.isdir(self.worktree):
|
||||
return
|
||||
for copyfile in self.copyfiles:
|
||||
copyfile._Copy()
|
||||
for linkfile in self.linkfiles:
|
||||
|
||||
Reference in New Issue
Block a user