◐ Shell
reader mode source ↗
Skip to content
Merged
Hide file tree
Changes from all commits
File filter
Conversations
Jump to
Diff view
Apply and reload
Show whitespace
Diff view
Apply and reload
2 changes: 1 addition & 1 deletion git/index/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,7 @@ def _items_to_rela_paths(
for item in items:
if isinstance(item, (BaseIndexEntry, (Blob, Submodule))):
paths.append(self._to_relative_path(item.path))
elif isinstance(item, str):
paths.append(self._to_relative_path(item))
else:
raise TypeError("Invalid item type: %r" % item)
Expand Down
12 changes: 7 additions & 5 deletions test/test_index.py
Original file line number Diff line number Diff line change
Expand Up @@ -558,14 +558,16 @@ def test_index_mutation(self, rw_repo):
def mixed_iterator():
count = 0
for entry in index.entries.values():
type_id = count % 4
if type_id == 0: # path
yield entry.path
elif type_id == 1: # blob
yield Blob(rw_repo, entry.binsha, entry.mode, entry.path)
elif type_id == 2: # BaseIndexEntry
yield BaseIndexEntry(entry[:4])
elif type_id == 3: # IndexEntry
yield entry
else:
raise AssertionError("Invalid Type")
Expand Down
Toggle all file notes Toggle all file annotations