diff options
| author | Mike Frysinger <vapier@google.com> | 2020-02-29 02:53:41 -0500 |
|---|---|---|
| committer | David Pursehouse <dpursehouse@collab.net> | 2020-03-17 05:39:17 +0000 |
| commit | 7936ce867707658929df8b234ff3449dea4d4a0a (patch) | |
| tree | 46ed3aa440a2f6e9fd7661b70a4cc62012b5999f | |
| parent | 23c900f105dd88bb404cfada0377fa817881cff8 (diff) | |
| download | git-repo-7936ce867707658929df8b234ff3449dea4d4a0a.tar.gz | |
init: respect --repo-url changes
We respect this option when running the first `repo init`, but then
silently ignore it once the initial sync is done. Make sure users
are able to change things on the fly.
Bug: https://crbug.com/gerrit/11045
Change-Id: I129ec5fec43a85067d555bb60c0d1ae02465f139
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/258893
Tested-by: David Pursehouse <dpursehouse@collab.net>
Reviewed-by: David Pursehouse <dpursehouse@collab.net>
| -rw-r--r-- | subcmds/init.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/subcmds/init.py b/subcmds/init.py index 20030068..94bd44ca 100644 --- a/subcmds/init.py +++ b/subcmds/init.py | |||
| @@ -490,6 +490,14 @@ to update the working directory files. | |||
| 490 | opt.quiet = opt.output_mode is False | 490 | opt.quiet = opt.output_mode is False |
| 491 | opt.verbose = opt.output_mode is True | 491 | opt.verbose = opt.output_mode is True |
| 492 | 492 | ||
| 493 | rp = self.manifest.repoProject | ||
| 494 | |||
| 495 | # Handle new --repo-url requests. | ||
| 496 | if opt.repo_url: | ||
| 497 | remote = rp.GetRemote('origin') | ||
| 498 | remote.url = opt.repo_url | ||
| 499 | remote.Save() | ||
| 500 | |||
| 493 | if opt.worktree: | 501 | if opt.worktree: |
| 494 | # Older versions of git supported worktree, but had dangerous gc bugs. | 502 | # Older versions of git supported worktree, but had dangerous gc bugs. |
| 495 | git_require((2, 15, 0), fail=True, msg='git gc worktree corruption') | 503 | git_require((2, 15, 0), fail=True, msg='git gc worktree corruption') |
