summaryrefslogtreecommitdiffstats
path: root/subcmds/sync.py
diff options
context:
space:
mode:
authorDavid Pursehouse <david.pursehouse@sonymobile.com>2015-10-14 10:50:15 +0900
committerDavid Pursehouse <david.pursehouse@sonymobile.com>2015-10-27 03:04:17 +0000
commit74cfd2709b0bc23fc3efb8951b4b5abb2bf4e4a7 (patch)
tree3df8296e4e9673893cf5fd7ed77b888e606311bf /subcmds/sync.py
parentc2a64ddffd397f28c1187da1cc07f29825b7d0fb (diff)
downloadgit-repo-74cfd2709b0bc23fc3efb8951b4b5abb2bf4e4a7.tar.gz
Sync: Add option to prune refs during sync
By passing --prune to the sync command, the --prune option is given to the `git fetch`, causing refs that no longer exist on the remote to be removed. Change-Id: I3cedacce14276d96ac2d5aabf2d07fd05e92bc02
Diffstat (limited to 'subcmds/sync.py')
-rw-r--r--subcmds/sync.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/subcmds/sync.py b/subcmds/sync.py
index 2a77065c..e865e564 100644
--- a/subcmds/sync.py
+++ b/subcmds/sync.py
@@ -151,6 +151,9 @@ The --optimized-fetch option can be used to only fetch projects that
151are fixed to a sha1 revision if the sha1 revision does not already 151are fixed to a sha1 revision if the sha1 revision does not already
152exist locally. 152exist locally.
153 153
154The --prune option can be used to remove any refs that no longer
155exist on the remote.
156
154SSH Connections 157SSH Connections
155--------------- 158---------------
156 159
@@ -234,6 +237,8 @@ later is required to fix a server side protocol bug.
234 p.add_option('--optimized-fetch', 237 p.add_option('--optimized-fetch',
235 dest='optimized_fetch', action='store_true', 238 dest='optimized_fetch', action='store_true',
236 help='only fetch projects fixed to sha1 if revision does not exist locally') 239 help='only fetch projects fixed to sha1 if revision does not exist locally')
240 p.add_option('--prune', dest='prune', action='store_true',
241 help='delete refs that no longer exist on the remote')
237 if show_smart: 242 if show_smart:
238 p.add_option('-s', '--smart-sync', 243 p.add_option('-s', '--smart-sync',
239 dest='smart_sync', action='store_true', 244 dest='smart_sync', action='store_true',
@@ -305,7 +310,8 @@ later is required to fix a server side protocol bug.
305 force_sync=opt.force_sync, 310 force_sync=opt.force_sync,
306 clone_bundle=not opt.no_clone_bundle, 311 clone_bundle=not opt.no_clone_bundle,
307 no_tags=opt.no_tags, archive=self.manifest.IsArchive, 312 no_tags=opt.no_tags, archive=self.manifest.IsArchive,
308 optimized_fetch=opt.optimized_fetch) 313 optimized_fetch=opt.optimized_fetch,
314 prune=opt.prune)
309 self._fetch_times.Set(project, time.time() - start) 315 self._fetch_times.Set(project, time.time() - start)
310 316
311 # Lock around all the rest of the code, since printing, updating a set 317 # Lock around all the rest of the code, since printing, updating a set