diff options
author | Mike Frysinger <vapier@google.com> | 2020-02-10 21:35:48 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@google.com> | 2020-02-11 04:23:26 +0000 |
commit | 07392ed32662006c029299bc06617310cfe17957 (patch) | |
tree | 844401eb75253096795c47689943164e840ffe8a /project.py | |
parent | 3285e4b436b7f25563179f5bc7191074d3515698 (diff) | |
download | git-repo-07392ed32662006c029299bc06617310cfe17957.tar.gz |
project: allow src=. with symlinksv2.1.1
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>
Diffstat (limited to 'project.py')
-rw-r--r-- | project.py | 7 |
1 files changed, 6 insertions, 1 deletions
@@ -382,7 +382,12 @@ class _LinkFile(object): | |||
382 | Handles wild cards on the src linking all of the files in the source in to | 382 | Handles wild cards on the src linking all of the files in the source in to |
383 | the destination directory. | 383 | the destination directory. |
384 | """ | 384 | """ |
385 | src = _SafeExpandPath(self.git_worktree, self.src) | 385 | # Some people use src="." to create stable links to projects. Lets allow |
386 | # that but reject all other uses of "." to keep things simple. | ||
387 | if self.src == '.': | ||
388 | src = self.git_worktree | ||
389 | else: | ||
390 | src = _SafeExpandPath(self.git_worktree, self.src) | ||
386 | 391 | ||
387 | if os.path.exists(src): | 392 | if os.path.exists(src): |
388 | # Entity exists so just a simple one to one link operation. | 393 | # Entity exists so just a simple one to one link operation. |