diff options
Diffstat (limited to 'subcmds/init.py')
-rw-r--r-- | subcmds/init.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/subcmds/init.py b/subcmds/init.py index 431165d4..ce8b0187 100644 --- a/subcmds/init.py +++ b/subcmds/init.py | |||
@@ -38,6 +38,7 @@ from project import SyncBuffer | |||
38 | from git_config import GitConfig | 38 | from git_config import GitConfig |
39 | from git_command import git_require, MIN_GIT_VERSION_SOFT, MIN_GIT_VERSION_HARD | 39 | from git_command import git_require, MIN_GIT_VERSION_SOFT, MIN_GIT_VERSION_HARD |
40 | import platform_utils | 40 | import platform_utils |
41 | from wrapper import Wrapper | ||
41 | 42 | ||
42 | 43 | ||
43 | class Init(InteractiveCommand, MirrorSafeCommand): | 44 | class Init(InteractiveCommand, MirrorSafeCommand): |
@@ -499,6 +500,16 @@ to update the working directory files. | |||
499 | remote.url = opt.repo_url | 500 | remote.url = opt.repo_url |
500 | remote.Save() | 501 | remote.Save() |
501 | 502 | ||
503 | # Handle new --repo-rev requests. | ||
504 | if opt.repo_rev: | ||
505 | wrapper = Wrapper() | ||
506 | remote_ref, rev = wrapper.check_repo_rev( | ||
507 | rp.gitdir, opt.repo_rev, repo_verify=opt.repo_verify, quiet=opt.quiet) | ||
508 | branch = rp.GetBranch('default') | ||
509 | branch.merge = remote_ref | ||
510 | rp.work_git.update_ref('refs/heads/default', rev) | ||
511 | branch.Save() | ||
512 | |||
502 | if opt.worktree: | 513 | if opt.worktree: |
503 | # Older versions of git supported worktree, but had dangerous gc bugs. | 514 | # Older versions of git supported worktree, but had dangerous gc bugs. |
504 | git_require((2, 15, 0), fail=True, msg='git gc worktree corruption') | 515 | git_require((2, 15, 0), fail=True, msg='git gc worktree corruption') |