@@ -121,8 +121,10 @@ def blob_processor(package: ACBSPackageInfo, index: int, source_name: str) -> No
121121
122122def git_fetch (info : ACBSSourceInfo , source_location : str , name : str ) -> Optional [ACBSSourceInfo ]:
123123 try :
124+ # Try use gix
124125 return gix_fetch (info , source_location , name )
125126 except :
127+ # Fallback to git
126128 full_path = os .path .join (source_location , name )
127129 if not os .path .exists (full_path ):
128130 subprocess .check_call (['git' , 'clone' , '--bare' , info .url , full_path ])
@@ -139,8 +141,10 @@ def gix_fetch(info: ACBSSourceInfo, source_location: str, name: str) -> Optional
139141 if not os .path .exists (full_path ):
140142 subprocess .check_call (['gix' , 'clone' , '--bare' , info .url , full_path ])
141143 else :
142- logging .info ('Updating repository...' )
144+ logging .info ('Updating repository with gix ...' )
143145 # gix doesn't have the --prune option yet.
146+ subprocess .check_cell (['git' , 'update-ref' , 'HEAD' , 'HEAD^' ], cwd = full_path )
147+ os .remove (os .path .join (full_path , "index" ))
144148 subprocess .check_call (
145149 ['gix' , 'fetch' , 'origin' , '+refs/heads/*:refs/heads/*' ], cwd = full_path )
146150 info .source_location = full_path
0 commit comments