@@ -57,6 +57,7 @@ plugin.mktemplate.argtypes = [ctypes.c_char_p, ctypes.c_char_p,
5757 ctypes .c_char_p , ctypes .c_char_p ,
5858 ctypes .c_char_p ]
5959plugin .mktemplate .restype = ctypes .c_char_p
60+ plugin .fetchpattern .argtypes = [ctypes .c_char ]
6061
6162if not hasattr (pygit2 .enums , 'FileMode' ):
6263 class FileMode (enum .IntFlag ):
@@ -182,7 +183,7 @@ class CryptRepo:
182183 self .trust (force = True , sign = True )
183184 else :
184185 self .repo = pygit2 .Repository ('.' )
185- self . _fetch ('_' )
186+ plugin . fetchpattern ('_' . encode ( 'utf-8' )[ 0 ] )
186187 self .meta = MetaData (self .repo ).read ()
187188 if forcetrust :
188189 self .trust (force = forcetrust )
@@ -230,16 +231,6 @@ class CryptRepo:
230231 ([f'^{ x } \n ' for x in excl ] if excl else [])))
231232 return text .strip ().split ('\n ' ) if text else []
232233
233- def _fetch (self , pattern ):
234- subprocess .run (
235- ['git' , 'fetch' ,
236- CryptRepo .verbosityflags [plugin .getverbosity ()],
237- '--progress' if plugin .getprogress () else '--no-progress' ,
238- '--no-write-fetch-head' , '-p' , plugin .geturl ().decode ('utf-8' ),
239- f'+refs/heads/{ pattern } :{
240- plugin .getprefix ().decode ("utf-8" )} 1/{ pattern } ' ],
241- cwd = self .repo .path , check = True , stdout = sys .stderr )
242-
243234 def trust (self , force = False , sign = False ):
244235 'trust this repository'
245236 if force :
@@ -275,7 +266,7 @@ class CryptRepo:
275266 'decrypt an object'
276267 raw = decryptdata (self .repo .get (oid ).read_raw (), self .meta .key )
277268 return self .repo .odb .write (raw [20 ], raw [21 :])
278- self . _fetch ('*' )
269+ plugin . fetchpattern ('*' . encode ( 'utf-8' )[ 0 ] )
279270 self .meta .read ()
280271 self .trust ()
281272 # [ dec(crypt) , prefdec(crypt), crypt ]
0 commit comments