@@ -237,7 +237,7 @@ def push_refspecs(self):
237237 check_error (err )
238238 return strarray_to_strings (specs )
239239
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 ):
241241 """
242242 Push the given refspec to the remote. Raises ``GitError`` on protocol
243243 error or unpack failure.
@@ -263,9 +263,19 @@ def push(self, specs, callbacks=None, proxy=None, push_options=None):
263263 push_options : [str]
264264 Push options to send to the server, which passes them to the
265265 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.
266275 """
267276 with git_push_options (callbacks ) as payload :
268277 opts = payload .push_options
278+ opts .pb_parallelism = threads
269279 self .__set_proxy (opts .proxy_opts , proxy )
270280 with StrArray (specs ) as refspecs , StrArray (push_options ) as pushopts :
271281 pushopts .assign_to (opts .remote_push_options )
0 commit comments