From 07392ed32662006c029299bc06617310cfe17957 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Mon, 10 Feb 2020 21:35:48 -0500 Subject: project: allow src=. with symlinks Some Android/Nest manifests are using 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 Reviewed-by: Mike Frysinger Tested-by: Mike Frysinger --- project.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'project.py') diff --git a/project.py b/project.py index 185507c0..a305d720 100644 --- a/project.py +++ b/project.py @@ -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. -- cgit v1.2.3-54-g00ecf