diff --git a/subcmds/sync.py b/subcmds/sync.py index d4e302ac2..2e6afccc4 100644 --- a/subcmds/sync.py +++ b/subcmds/sync.py @@ -249,8 +249,10 @@ later is required to fix a server side protocol bug. p.add_option('--retry-fetches', default=0, action='store', type='int', help='number of times to retry fetches on transient errors') - p.add_option('--prune', dest='prune', action='store_true', - help='delete refs that no longer exist on the remote') + p.add_option('--prune', action='store_true', + help='delete refs that no longer exist on the remote (default)') + p.add_option('--no-prune', dest='prune', action='store_false', + help='do not delete refs that no longer exist on the remote') if show_smart: p.add_option('-s', '--smart-sync', dest='smart_sync', action='store_true', @@ -927,6 +929,9 @@ later is required to fix a server side protocol bug. if None in [opt.manifest_server_username, opt.manifest_server_password]: self.OptionParser.error('both -u and -p must be given') + if opt.prune is None: + opt.prune = True + def Execute(self, opt, args): if opt.jobs: self.jobs = opt.jobs