diff --git a/repo b/repo index 2af77ace..6d7ce42a 100755 --- a/repo +++ b/repo @@ -618,6 +618,7 @@ def _Init(args, gitc_init=False): "REPO_URL set correctly?" % url, file=sys.stderr) except CloneFailure: + print('fatal: double check your --repo-rev setting.', file=sys.stderr) if opt.quiet: print('fatal: repo init failed; run without --quiet to see why', file=sys.stderr) diff --git a/subcmds/init.py b/subcmds/init.py index e2f34cc8..b0db76a4 100644 --- a/subcmds/init.py +++ b/subcmds/init.py @@ -520,8 +520,12 @@ to update the working directory files. # Handle new --repo-rev requests. if opt.repo_rev: wrapper = Wrapper() - remote_ref, rev = wrapper.check_repo_rev( - rp.gitdir, opt.repo_rev, repo_verify=opt.repo_verify, quiet=opt.quiet) + try: + remote_ref, rev = wrapper.check_repo_rev( + rp.gitdir, opt.repo_rev, repo_verify=opt.repo_verify, quiet=opt.quiet) + except wrapper.CloneFailure: + print('fatal: double check your --repo-rev setting.', file=sys.stderr) + sys.exit(1) branch = rp.GetBranch('default') branch.merge = remote_ref rp.work_git.reset('--hard', rev)