Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit93ae6ec

Browse files
committed
Fixed regression that would possibly have caused an abundance of chdir calls.
1 parentca4c1b8 commit93ae6ec

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

‎git/index/base.py

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -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
ifS_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= [ifori,einenumerate(entries)ife.binsha==Object.NULL_BIN_SHA ]
709709
ifnull_entries_indices:
710-
foreiinnull_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+
defhandle_null_entries(self):
712+
foreiinnull_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

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp