@@ -559,9 +559,9 @@ def _preprocess_add_items(self, items):
559559 # END for each item
560560 return (paths , entries )
561561
562- @git_working_dir
563562 def _store_path (self , filepath , fprogress ):
564- """Store file at filepath in the database and return the base index entry"""
563+ """Store file at filepath in the database and return the base index entry
564+ Needs the git_working_dir decorator active ! This must be assured in the calling code"""
565565 st = os .lstat (filepath ) # handles non-symlinks as well
566566 stream = None
567567 if S_ISLNK (st .st_mode ):
@@ -707,13 +707,17 @@ def add(self, items, force=True, fprogress=lambda *args: None, path_rewriter=Non
707707 # create objects if required, otherwise go with the existing shas
708708 null_entries_indices = [ i for i ,e in enumerate (entries ) if e .binsha == Object .NULL_BIN_SHA ]
709709 if null_entries_indices :
710- for ei in null_entries_indices :
711- null_entry = entries [ei ]
712- new_entry = self ._store_path (null_entry .path , fprogress )
713-
714- # update null entry
715- entries [ei ] = BaseIndexEntry ((null_entry .mode , new_entry .binsha , null_entry .stage , null_entry .path ))
716- # END for each entry index
710+ @git_working_dir
711+ def handle_null_entries (self ):
712+ for ei in null_entries_indices :
713+ null_entry = entries [ei ]
714+ new_entry = self ._store_path (null_entry .path , fprogress )
715+
716+ # update null entry
717+ entries [ei ] = BaseIndexEntry ((null_entry .mode , new_entry .binsha , null_entry .stage , null_entry .path ))
718+ # END for each entry index
719+ # end closure
720+ handle_null_entries (self )
717721 # END null_entry handling
718722
719723 # REWRITE PATHS
0 commit comments