| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 57a3af1 commit df8087a
7 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1360,7 +1360,7 @@ def make_exc() -> GitCommandError: | |||
| 1360 | 1360 | try: | |
| 1361 | 1361 | self.entries[(co_path, 0)] | |
| 1362 | 1362 | except KeyError: | |
| 1363 | - folder = os.fspath(co_path) | ||
| 1363 | + folder = co_path | ||
| 1364 | 1364 | if not folder.endswith("/"): | |
| 1365 | 1365 | folder += "/" | |
| 1366 | 1366 | for entry in self.entries.values(): | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -87,7 +87,7 @@ def run_commit_hook(name: str, index: "IndexFile", *args: str) -> None: | |||
| 87 | 87 | return | |
| 88 | 88 | ||
| 89 | 89 | env = os.environ.copy() | |
| 90 | - env["GIT_INDEX_FILE"] = safe_decode(os.fspath(index.path)) | ||
| 90 | + env["GIT_INDEX_FILE"] = safe_decode(index.path) | ||
| 91 | 91 | env["GIT_EDITOR"] = ":" | |
| 92 | 92 | cmd = [hp] | |
| 93 | 93 | try: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1229,7 +1229,7 @@ def remove( | |||
| 1229 | 1229 | wtd = mod.working_tree_dir | |
| 1230 | 1230 | del mod # Release file-handles (Windows). | |
| 1231 | 1231 | gc.collect() | |
| 1232 | - rmtree(str(wtd)) | ||
| 1232 | + rmtree(wtd) | ||
| 1233 | 1233 | # END delete tree if possible | |
| 1234 | 1234 | # END handle force | |
| 1235 | 1235 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -706,7 +706,7 @@ def _create( | |||
| 706 | 706 | if not force and os.path.isfile(abs_ref_path): | |
| 707 | 707 | target_data = str(target) | |
| 708 | 708 | if isinstance(target, SymbolicReference): | |
| 709 | - target_data = os.fspath(target.path) | ||
| 709 | + target_data = target.path | ||
| 710 | 710 | if not resolve: | |
| 711 | 711 | target_data = "ref: " + target_data | |
| 712 | 712 | with open(abs_ref_path, "rb") as fd: | |
@@ -931,4 +931,4 @@ def from_path(cls: Type[T_References], repo: "Repo", path: PathLike) -> T_Refere | |||
| 931 | 931 | ||
| 932 | 932 | def is_remote(self) -> bool: | |
| 933 | 933 | """:return: True if this symbolic reference points to a remote branch""" | |
| 934 | - return os.fspath(self.path).startswith(self._remote_common_path_default + "/") | ||
| 934 | + return self.path.startswith(self._remote_common_path_default + "/") | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -126,7 +126,7 @@ class Repo: | |||
| 126 | 126 | working_dir: PathLike | |
| 127 | 127 | """The working directory of the git command.""" | |
| 128 | 128 | ||
| 129 | - _working_tree_dir: Optional[PathLike] = None | ||
| 129 | + _working_tree_dir: Optional[str] = None | ||
| 130 | 130 | ||
| 131 | 131 | git_dir: PathLike | |
| 132 | 132 | """The ``.git`` repository directory.""" | |
@@ -306,7 +306,7 @@ def __init__( | |||
| 306 | 306 | self._working_tree_dir = None | |
| 307 | 307 | # END working dir handling | |
| 308 | 308 | ||
| 309 | - self.working_dir: PathLike = self._working_tree_dir or self.common_dir | ||
| 309 | + self.working_dir: str = self._working_tree_dir or self.common_dir | ||
| 310 | 310 | self.git = self.GitCommandWrapperType(self.working_dir) | |
| 311 | 311 | ||
| 312 | 312 | # Special handling, in special times. | |
@@ -366,7 +366,7 @@ def description(self, descr: str) -> None: | |||
| 366 | 366 | fp.write((descr + "\n").encode(defenc)) | |
| 367 | 367 | ||
| 368 | 368 | @property | |
| 369 | - def working_tree_dir(self) -> Optional[PathLike]: | ||
| 369 | + def working_tree_dir(self) -> Optional[str]: | ||
| 370 | 370 | """ | |
| 371 | 371 | :return: | |
| 372 | 372 | The working tree directory of our git repository. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -397,8 +397,7 @@ def _cygexpath(drive: Optional[str], path: str) -> str: | |||
| 397 | 397 | p = cygpath(p) | |
| 398 | 398 | elif drive: | |
| 399 | 399 | p = "/proc/cygdrive/%s/%s" % (drive.lower(), p) | |
| 400 | - p_str = os.fspath(p) # ensure it is a str and not AnyPath | ||
| 401 | - return p_str.replace("\\", "/") | ||
| 400 | + return p.replace("\\", "/") | ||
| 402 | 401 | ||
| 403 | 402 | ||
| 404 | 403 | _cygpath_parsers: Tuple[Tuple[Pattern[str], Callable, bool], ...] = ( | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -579,12 +579,14 @@ def mixed_iterator(): | |||
| 579 | 579 | if type_id == 0: # path (str) | |
| 580 | 580 | yield entry.path | |
| 581 | 581 | elif type_id == 1: # path (PathLike) | |
| 582 | + yield Path(entry.path) | ||
| 583 | + elif type_id == 2: # path mock (PathLike) | ||
| 582 | 584 | yield PathLikeMock(entry.path) | |
| 583 | - elif type_id == 2: # blob | ||
| 585 | + elif type_id == 3: # blob | ||
| 584 | 586 | yield Blob(rw_repo, entry.binsha, entry.mode, entry.path) | |
| 585 | - elif type_id == 3: # BaseIndexEntry | ||
| 587 | + elif type_id == 4: # BaseIndexEntry | ||
| 586 | 588 | yield BaseIndexEntry(entry[:4]) | |
| 587 | - elif type_id == 4: # IndexEntry | ||
| 589 | + elif type_id == 5: # IndexEntry | ||
| 588 | 590 | yield entry | |
| 589 | 591 | else: | |
| 590 | 592 | raise AssertionError("Invalid Type") | |
| Back | FazBrowse Home | New Git URL |
0 commit comments