@@ -237,7 +237,7 @@ def push_refspecs(self):
237
237
check_error (err )
238
238
return strarray_to_strings (specs )
239
239
240
- def push (self , specs , callbacks = None , proxy = None , push_options = None ):
240
+ def push (self , specs , callbacks = None , proxy = None , push_options = None , threads = 1 ):
241
241
"""
242
242
Push the given refspec to the remote. Raises ``GitError`` on protocol
243
243
error or unpack failure.
@@ -263,9 +263,19 @@ def push(self, specs, callbacks=None, proxy=None, push_options=None):
263
263
push_options : [str]
264
264
Push options to send to the server, which passes them to the
265
265
pre-receive as well as the post-receive hook.
266
+
267
+ threads : int
268
+ If the transport being used to push to the remote requires the
269
+ creation of a pack file, this controls the number of worker threads
270
+ used by the packbuilder when creating that pack file to be sent to
271
+ the remote.
272
+
273
+ If set to 0, the packbuilder will auto-detect the number of threads
274
+ to create. The default value is 1.
266
275
"""
267
276
with git_push_options (callbacks ) as payload :
268
277
opts = payload .push_options
278
+ opts .pb_parallelism = threads
269
279
self .__set_proxy (opts .proxy_opts , proxy )
270
280
with StrArray (specs ) as refspecs , StrArray (push_options ) as pushopts :
271
281
pushopts .assign_to (opts .remote_push_options )
0 commit comments