mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-21 07:16:21 +00:00
Add 'repo sync -n' to only do the network transfer
This makes it easier to update all repositories, without actually impacting the working directory, or learning about how to use `repo forall -c 'git fetch $REPO_REMOTE' `. Signed-off-by: Shawn O. Pearce <sop@google.com>
This commit is contained in:
parent
2a1ccb2b0c
commit
96fdcef9e3
@ -47,6 +47,9 @@ the manifest.
|
||||
"""
|
||||
|
||||
def _Options(self, p):
|
||||
p.add_option('-n','--network-only',
|
||||
dest='network_only', action='store_true',
|
||||
help="fetch only, don't update working tree")
|
||||
p.add_option('--no-repo-verify',
|
||||
dest='no_repo_verify', action='store_true',
|
||||
help='do not verify repo source code')
|
||||
@ -90,6 +93,10 @@ the manifest.
|
||||
else:
|
||||
print >>sys.stderr, 'warning: Skipped upgrade to unverified version'
|
||||
|
||||
if opt.network_only:
|
||||
# bail out now; the rest touches the working tree
|
||||
return
|
||||
|
||||
if mp.HasChanges:
|
||||
if not mp.Sync_LocalHalf():
|
||||
sys.exit(1)
|
||||
|
Loading…
Reference in New Issue
Block a user