Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 902b6be

Browse files
Rename set_max_threads method to set_threads
1 parent ecdafb8 commit 902b6be

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

pygit2/packbuilder.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def add_recur(self, git_object):
6868
err = C.git_packbuilder_insert_recur(self._packbuilder, oid, ffi.NULL)
6969
check_error(err)
7070

71-
def set_max_threads(self, n_threads):
71+
def set_threads(self, n_threads):
7272
return C.git_packbuilder_set_threads(self._packbuilder, n_threads)
7373

7474
def write(self, path=None):

pygit2/repository.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ def write(self, *args, **kwargs):
8484
object."""
8585
return self.odb.write(*args, **kwargs)
8686

87-
def pack(self, path=None, pack_delegate=None, max_threads=None):
87+
def pack(self, path=None, pack_delegate=None, num_threads=None):
8888
"""Pack the objects in the odb chosen by the pack_delegate function
8989
and write .pack and .idx files for them.
9090
@@ -93,13 +93,13 @@ def pack(self, path=None, pack_delegate=None, max_threads=None):
9393
Parameters:
9494
9595
path
96-
The path to which the .pack and .idx files should be written. None will write to the default location
96+
The path to which the .pack and .idx files should be written. None will write to the default location.
9797
9898
pack_delegate
9999
The method which will provide add the objects to the pack builder. Defaults to all objects.
100100
101-
max_threads
102-
The maximum number of threads the PackBuilder will spawn.
101+
num_threads
102+
The number of threads the PackBuilder will spawn. If set to 0 libgit2 will autodetect the number of CPUs.
103103
"""
104104

105105
def pack_all_objects(pack_builder):
@@ -109,8 +109,8 @@ def pack_all_objects(pack_builder):
109109
pack_delegate = pack_delegate or pack_all_objects
110110

111111
builder = PackBuilder(self)
112-
if max_threads:
113-
builder.set_max_threads(max_threads)
112+
if num_threads is not None:
113+
builder.set_threads(num_threads)
114114
pack_delegate(builder)
115115
builder.write(path=path)
116116

0 commit comments

Comments
 (0)