diff options
| -rw-r--r-- | project.py | 13 |
1 files changed, 3 insertions, 10 deletions
| @@ -2061,10 +2061,7 @@ class Project: | |||
| 2061 | if head == revid: | 2061 | if head == revid: |
| 2062 | # Same revision; just update HEAD to point to the new | 2062 | # Same revision; just update HEAD to point to the new |
| 2063 | # target branch, but otherwise take no other action. | 2063 | # target branch, but otherwise take no other action. |
| 2064 | _lwrite( | 2064 | self.work_git.SetHead(R_HEADS + name) |
| 2065 | self.work_git.GetDotgitPath(subpath=HEAD), | ||
| 2066 | f"ref: {R_HEADS}{name}\n", | ||
| 2067 | ) | ||
| 2068 | return True | 2065 | return True |
| 2069 | 2066 | ||
| 2070 | GitCommand( | 2067 | GitCommand( |
| @@ -2100,9 +2097,7 @@ class Project: | |||
| 2100 | 2097 | ||
| 2101 | revid = self.GetRevisionId(all_refs) | 2098 | revid = self.GetRevisionId(all_refs) |
| 2102 | if head == revid: | 2099 | if head == revid: |
| 2103 | _lwrite( | 2100 | self.work_git.DetachHead(revid) |
| 2104 | self.work_git.GetDotgitPath(subpath=HEAD), "%s\n" % revid | ||
| 2105 | ) | ||
| 2106 | else: | 2101 | else: |
| 2107 | self._Checkout(revid, quiet=True) | 2102 | self._Checkout(revid, quiet=True) |
| 2108 | GitCommand( | 2103 | GitCommand( |
| @@ -3492,9 +3487,7 @@ class Project: | |||
| 3492 | self._createDotGit(dotgit) | 3487 | self._createDotGit(dotgit) |
| 3493 | 3488 | ||
| 3494 | if init_dotgit: | 3489 | if init_dotgit: |
| 3495 | _lwrite( | 3490 | self.work_git.UpdateRef(HEAD, self.GetRevisionId(), detach=True) |
| 3496 | os.path.join(self.gitdir, HEAD), f"{self.GetRevisionId()}\n" | ||
| 3497 | ) | ||
| 3498 | 3491 | ||
| 3499 | # Finish checking out the worktree. | 3492 | # Finish checking out the worktree. |
| 3500 | cmd = ["read-tree", "--reset", "-u", "-v", HEAD] | 3493 | cmd = ["read-tree", "--reset", "-u", "-v", HEAD] |
