@@ -121,8 +121,10 @@ def blob_processor(package: ACBSPackageInfo, index: int, source_name: str) -> No
121
121
122
122
def git_fetch (info : ACBSSourceInfo , source_location : str , name : str ) -> Optional [ACBSSourceInfo ]:
123
123
try :
124
+ # Try use gix
124
125
return gix_fetch (info , source_location , name )
125
126
except :
127
+ # Fallback to git
126
128
full_path = os .path .join (source_location , name )
127
129
if not os .path .exists (full_path ):
128
130
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
139
141
if not os .path .exists (full_path ):
140
142
subprocess .check_call (['gix' , 'clone' , '--bare' , info .url , full_path ])
141
143
else :
142
- logging .info ('Updating repository...' )
144
+ logging .info ('Updating repository with gix ...' )
143
145
# 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" ))
144
148
subprocess .check_call (
145
149
['gix' , 'fetch' , 'origin' , '+refs/heads/*:refs/heads/*' ], cwd = full_path )
146
150
info .source_location = full_path
0 commit comments