mirror of
https://github.com/Dev-Wiki/git-repo.git
synced 2025-12-14 00:24:05 +08:00
project: allow src=. with symlinks
Some Android/Nest manifests are using <linkfile> with src="." to create stable paths to specific projects. Allow that specific use case as it seems reasonable to support. Bug: https://crbug.com/gerrit/11218 Change-Id: I16dbe8d9fe42ea45440afcb61404c753bff1930d Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/254330 Reviewed-by: Chanho Park <parkch98@gmail.com> Reviewed-by: Mike Frysinger <vapier@google.com> Tested-by: Mike Frysinger <vapier@google.com>
This commit is contained in:
@@ -382,7 +382,12 @@ class _LinkFile(object):
|
||||
Handles wild cards on the src linking all of the files in the source in to
|
||||
the destination directory.
|
||||
"""
|
||||
src = _SafeExpandPath(self.git_worktree, self.src)
|
||||
# Some people use src="." to create stable links to projects. Lets allow
|
||||
# that but reject all other uses of "." to keep things simple.
|
||||
if self.src == '.':
|
||||
src = self.git_worktree
|
||||
else:
|
||||
src = _SafeExpandPath(self.git_worktree, self.src)
|
||||
|
||||
if os.path.exists(src):
|
||||
# Entity exists so just a simple one to one link operation.
|
||||
|
||||
Reference in New Issue
Block a user