@@ -119,21 +119,28 @@ def blob_processor(package: ACBSPackageInfo, index: int, source_name: str) -> No
119
119
return tarball_processor_innner (package , index , source_name , False )
120
120
121
121
122
- def git_fetch (info : ACBSSourceInfo , source_location : str , name : str ) -> Optional [ACBSSourceInfo ]:
123
- try :
124
- # Try use gix
125
- return gix_fetch (info , source_location , name )
126
- except :
127
- # Fallback to git
128
- full_path = os .path .join (source_location , name )
129
- if not os .path .exists (full_path ):
130
- subprocess .check_call (['git' , 'clone' , '--bare' , info .url , full_path ])
131
- else :
132
- logging .info ('Updating repository...' )
133
- subprocess .check_call (
122
+ def git_fetch_fallback (info : ACBSSourceInfo , source_location : str , name : str ) -> Optional [ACBSSourceInfo ]:
123
+ if info .no_gix :
124
+ return git_fetch (info , source_location , name )
125
+ else :
126
+ try :
127
+ # Try use gix
128
+ return gix_fetch (info , source_location , name )
129
+ except :
130
+ # Fallback to git
131
+ return git_fetch (info , source_location , name )
132
+
133
+
134
+ def git_fetch (info , source_location , name ):
135
+ full_path = os .path .join (source_location , name )
136
+ if not os .path .exists (full_path ):
137
+ subprocess .check_call (['git' , 'clone' , '--bare' , info .url , full_path ])
138
+ else :
139
+ logging .info ('Updating repository...' )
140
+ subprocess .check_call (
134
141
['git' , 'fetch' , 'origin' , '+refs/heads/*:refs/heads/*' , '--prune' ], cwd = full_path )
135
- info .source_location = full_path
136
- return info
142
+ info .source_location = full_path
143
+ return info
137
144
138
145
139
146
def gix_hack (path : str ):
@@ -334,7 +341,7 @@ def fossil_processor(package: ACBSPackageInfo, index: int, source_name: str) ->
334
341
335
342
336
343
handlers : Dict [str , pair_signature ] = {
337
- 'GIT' : (git_fetch , git_processor ),
344
+ 'GIT' : (git_fetch_fallback , git_processor ),
338
345
'SVN' : (svn_fetch , svn_processor ),
339
346
'BZR' : (bzr_fetch , bzr_processor ),
340
347
'HG' : (hg_fetch , hg_processor ),
0 commit comments