diff options
author | Mike Frysinger <vapier@google.com> | 2022-08-19 06:47:35 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@google.com> | 2022-08-22 21:01:10 +0000 |
commit | 488d54d4eea1e0bae5c6056ae628b783d4f716c0 (patch) | |
tree | 2f6a4d6d5659dde98d19db980d2f5b0b136ec608 | |
parent | 5a5cfce1b2efa50f3aa4eca850c1751f204e7404 (diff) | |
download | git-repo-488d54d4eea1e0bae5c6056ae628b783d4f716c0.tar.gz |
init: show a notice when reinitializing
Make it clear to users when we're reinitializing an existing checkout
in case they weren't expecting it.
Bug: https://crbug.com/gerrit/12396
Change-Id: I22e89ae041a8e7b147c9d06a82f1302dd5807ae0
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/343535
Reviewed-by: LaMont Jones <lamontjones@google.com>
Tested-by: Mike Frysinger <vapier@google.com>
-rw-r--r-- | subcmds/init.py | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/subcmds/init.py b/subcmds/init.py index bcccae06..803f39a6 100644 --- a/subcmds/init.py +++ b/subcmds/init.py | |||
@@ -315,6 +315,13 @@ to update the working directory files. | |||
315 | # Older versions of git supported worktree, but had dangerous gc bugs. | 315 | # Older versions of git supported worktree, but had dangerous gc bugs. |
316 | git_require((2, 15, 0), fail=True, msg='git gc worktree corruption') | 316 | git_require((2, 15, 0), fail=True, msg='git gc worktree corruption') |
317 | 317 | ||
318 | # Provide a short notice that we're reinitializing an existing checkout. | ||
319 | # Sometimes developers might not realize that they're in one, or that | ||
320 | # repo doesn't do nested checkouts. | ||
321 | existing_checkout = self.manifest.manifestProject.Exists | ||
322 | if not opt.quiet and existing_checkout: | ||
323 | print('repo: reusing existing repo client checkout in', self.manifest.topdir) | ||
324 | |||
318 | self._SyncManifest(opt) | 325 | self._SyncManifest(opt) |
319 | 326 | ||
320 | if os.isatty(0) and os.isatty(1) and not self.manifest.IsMirror: | 327 | if os.isatty(0) and os.isatty(1) and not self.manifest.IsMirror: |