| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -940,7 +940,7 @@ def _items_to_rela_paths( | |||
| 940 | 940 | for item in items: | |
| 941 | 941 | if isinstance(item, (BaseIndexEntry, (Blob, Submodule))): | |
| 942 | 942 | paths.append(self._to_relative_path(item.path)) | |
| 943 | - elif isinstance(item, str): | ||
| 943 | + elif isinstance(item, (str, os.PathLike)): | ||
| 944 | 944 | paths.append(self._to_relative_path(item)) | |
| 945 | 945 | else: | |
| 946 | 946 | raise TypeError("Invalid item type: %r" % item) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -558,14 +558,16 @@ def test_index_mutation(self, rw_repo): | |||
| 558 | 558 | def mixed_iterator(): | |
| 559 | 559 | count = 0 | |
| 560 | 560 | for entry in index.entries.values(): | |
| 561 | - type_id = count % 4 | ||
| 562 | - if type_id == 0: # path | ||
| 561 | + type_id = count % 5 | ||
| 562 | + if type_id == 0: # path (str) | ||
| 563 | 563 | yield entry.path | |
| 564 | - elif type_id == 1: # blob | ||
| 564 | + elif type_id == 1: # path (PathLike) | ||
| 565 | + yield Path(entry.path) | ||
| 566 | + elif type_id == 2: # blob | ||
| 565 | 567 | yield Blob(rw_repo, entry.binsha, entry.mode, entry.path) | |
| 566 | - elif type_id == 2: # BaseIndexEntry | ||
| 568 | + elif type_id == 3: # BaseIndexEntry | ||
| 567 | 569 | yield BaseIndexEntry(entry[:4]) | |
| 568 | - elif type_id == 3: # IndexEntry | ||
| 570 | + elif type_id == 4: # IndexEntry | ||
| 569 | 571 | yield entry | |
| 570 | 572 | else: | |
| 571 | 573 | raise AssertionError("Invalid Type") | |
| Back | FazBrowse Home | New Git URL |
0 commit comments