@@ -305,14 +305,11 @@ def sparse_checkout(self):
305305 else :
306306 print (f"Successfully checked out { self .name :>20} at { self .fxtag } " )
307307 status ,f = sprepo_git .git_operation ("status" )
308- checkout_nextline = False
309308 # Restore any files deleted from sandbox
310- for line in f .split ():
311- if checkout_nextline :
312- status , _ = sprepo_git .git_operation ("checkout" , line )
313- checkout_nextline = False
314- if line == "deleted:" :
315- checkout_nextline = True
309+ for line in f .splitlines ():
310+ if "deleted:" in line :
311+ deleted_file = line .split ("deleted:" )[1 ].strip ()
312+ sprepo_git .git_operation ("checkout" , deleted_file )
316313
317314 rgit .config_set_value ('submodule.' + self .name , "active" , "true" )
318315 rgit .config_set_value ('submodule.' + self .name , "url" , self .url )
@@ -351,9 +348,9 @@ async def update(self):
351348 repo_exists = True
352349 # Look for a .gitmodules file in the newly checkedout repo
353350 if self .fxsparse :
354- print (f"Sparse checkout { self .name } fxsparse { self .fxsparse } { git . repo_path } " )
351+ print (f"Sparse checkout { self .name } fxsparse { self .fxsparse } " )
355352 if not os .path .isfile (self .fxsparse ):
356- self .logger .info ("Submodule {} fxsparse file not found" )
353+ self .logger .info ("Submodule {} fxsparse file not found" . format ( self . name ) )
357354
358355 self .sparse_checkout ()
359356 else :
@@ -423,17 +420,18 @@ async def update(self):
423420 if fxtag and fxtag not in tags :
424421 git .git_operation ("fetch" , newremote , "--tags" )
425422 status , atag = git .git_operation ("describe" , "--tags" , "--always" )
426- status , files = git .git_operation ("diff" , "--name-only" )
423+ status , files = git .git_operation ("diff" , "--name-only" , "-z" )
427424 modfiles = []
428425 moddirs = []
429426 if files :
430- for f in files .split ():
431- if not os .path .exists (f ):
432- git .git_operation ("checkout" ,f )
433- elif os .path .isdir (f ):
434- moddirs .append (f )
435- else :
436- modfiles .append (f )
427+ for f in files .split ('\0 ' ):
428+ if f :
429+ if os .path .exists (f ):
430+ git .git_operation ("checkout" ,f )
431+ elif os .path .isdir (f ):
432+ moddirs .append (f )
433+ else :
434+ modfiles .append (f )
437435 if fxtag and fxtag != atag :
438436 try :
439437 status , _ = git .git_operation ("checkout" , fxtag )
0 commit comments