diff options
Diffstat (limited to 'project.py')
| -rw-r--r-- | project.py | 16 |
1 files changed, 8 insertions, 8 deletions
| @@ -2443,14 +2443,6 @@ class Project(object): | |||
| 2443 | self.bare_objdir.init() | 2443 | self.bare_objdir.init() |
| 2444 | 2444 | ||
| 2445 | if self.use_git_worktrees: | 2445 | if self.use_git_worktrees: |
| 2446 | # Set up the m/ space to point to the worktree-specific ref space. | ||
| 2447 | # We'll update the worktree-specific ref space on each checkout. | ||
| 2448 | if self.manifest.branch: | ||
| 2449 | self.bare_git.symbolic_ref( | ||
| 2450 | '-m', 'redirecting to worktree scope', | ||
| 2451 | R_M + self.manifest.branch, | ||
| 2452 | R_WORKTREE_M + self.manifest.branch) | ||
| 2453 | |||
| 2454 | # Enable per-worktree config file support if possible. This is more a | 2446 | # Enable per-worktree config file support if possible. This is more a |
| 2455 | # nice-to-have feature for users rather than a hard requirement. | 2447 | # nice-to-have feature for users rather than a hard requirement. |
| 2456 | if git_require((2, 20, 0)): | 2448 | if git_require((2, 20, 0)): |
| @@ -2587,6 +2579,14 @@ class Project(object): | |||
| 2587 | def _InitMRef(self): | 2579 | def _InitMRef(self): |
| 2588 | if self.manifest.branch: | 2580 | if self.manifest.branch: |
| 2589 | if self.use_git_worktrees: | 2581 | if self.use_git_worktrees: |
| 2582 | # Set up the m/ space to point to the worktree-specific ref space. | ||
| 2583 | # We'll update the worktree-specific ref space on each checkout. | ||
| 2584 | ref = R_M + self.manifest.branch | ||
| 2585 | if not self.bare_ref.symref(ref): | ||
| 2586 | self.bare_git.symbolic_ref( | ||
| 2587 | '-m', 'redirecting to worktree scope', | ||
| 2588 | ref, R_WORKTREE_M + self.manifest.branch) | ||
| 2589 | |||
| 2590 | # We can't update this ref with git worktrees until it exists. | 2590 | # We can't update this ref with git worktrees until it exists. |
| 2591 | # We'll wait until the initial checkout to set it. | 2591 | # We'll wait until the initial checkout to set it. |
| 2592 | if not os.path.exists(self.worktree): | 2592 | if not os.path.exists(self.worktree): |
