| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -416,11 +416,11 @@ def _write_git_file_and_module_config(cls, working_tree_dir: PathLike, module_ab | |||
| 416 | 416 | Absolute path to the bare repository. | |
| 417 | 417 | """ | |
| 418 | 418 | git_file = osp.join(working_tree_dir, ".git") | |
| 419 | - relative_fpath = osp.relpath(module_abspath, start=working_tree_dir) | ||
| 419 | + relative_path = osp.relpath(module_abspath, start=working_tree_dir) | ||
| 420 | 420 | if sys.platform == "win32" and osp.isfile(git_file): | |
| 421 | 421 | os.remove(git_file) | |
| 422 | 422 | with open(git_file, "wb") as fp: | |
| 423 | - fp.write(("gitdir: %s" % relative_fpath).encode(defenc)) | ||
| 423 | + fp.write(("gitdir: %s" % relative_path).encode(defenc)) | ||
| 424 | 424 | ||
| 425 | 425 | with GitConfigParser(osp.join(module_abspath, "config"), read_only=False, merge_includes=False) as writer: | |
| 426 | 426 | writer.set_value( | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -568,11 +568,11 @@ def addToStack( | |||
| 568 | 568 | yield rval | |
| 569 | 569 | ||
| 570 | 570 | # Only continue to next level if this is appropriate! | |
| 571 | - nb = d + 1 | ||
| 572 | - if depth > -1 and nb > depth: | ||
| 571 | + next_depth = d + 1 | ||
| 572 | + if depth > -1 and next_depth > depth: | ||
| 573 | 573 | continue | |
| 574 | 574 | ||
| 575 | - addToStack(stack, item, branch_first, nb) | ||
| 575 | + addToStack(stack, item, branch_first, next_depth) | ||
| 576 | 576 | # END for each item on work stack | |
| 577 | 577 | ||
| 578 | 578 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -272,7 +272,7 @@ def _get_ref_info(cls, repo: "Repo", ref_path: Union[PathLike, None]) -> Union[T | |||
| 272 | 272 | :return: | |
| 273 | 273 | *(str(sha), str(target_ref_path))*, where: | |
| 274 | 274 | ||
| 275 | - * *sha* is of the file at relative_fpath points to if available, or ``None``. | ||
| 275 | + * *sha* is of the file at relative_path points to if available, or ``None``. | ||
| 276 | 276 | * *target_ref_path* is the reference we point to, or ``None``. | |
| 277 | 277 | """ | |
| 278 | 278 | return cls._get_ref_info_helper(repo, ref_path) | |
@@ -813,7 +813,7 @@ def _iter_items( | |||
| 813 | 813 | ) -> Iterator[T_References]: | |
| 814 | 814 | if common_path is None: | |
| 815 | 815 | common_path = cls._common_path_default | |
| 816 | - relative_fpaths = set() | ||
| 816 | + relative_paths = set() | ||
| 817 | 817 | ||
| 818 | 818 | # Walk loose refs. | |
| 819 | 819 | # Currently we do not follow links. | |
@@ -828,19 +828,19 @@ def _iter_items( | |||
| 828 | 828 | if f == "packed-refs": | |
| 829 | 829 | continue | |
| 830 | 830 | abs_path = to_native_path_linux(join_path(root, f)) | |
| 831 | - relative_fpaths.add(abs_path.replace(to_native_path_linux(repo.common_dir) + "/", "")) | ||
| 831 | + relative_paths.add(abs_path.replace(to_native_path_linux(repo.common_dir) + "/", "")) | ||
| 832 | 832 | # END for each file in root directory | |
| 833 | 833 | # END for each directory to walk | |
| 834 | 834 | ||
| 835 | 835 | # Read packed refs. | |
| 836 | 836 | for _sha, relative_fpath in cls._iter_packed_refs(repo): | |
| 837 | 837 | if relative_fpath.startswith(str(common_path)): | |
| 838 | - relative_fpaths.add(relative_fpath) | ||
| 838 | + relative_paths.add(relative_fpath) | ||
| 839 | 839 | # END relative path matches common path | |
| 840 | 840 | # END packed refs reading | |
| 841 | 841 | ||
| 842 | 842 | # Yield paths in sorted order. | |
| 843 | - for path in sorted(relative_fpaths): | ||
| 843 | + for path in sorted(relative_paths): | ||
| 844 | 844 | try: | |
| 845 | 845 | yield cls.from_path(repo, path) | |
| 846 | 846 | except ValueError: | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -386,15 +386,15 @@ def tearDownClass(cls): | |||
| 386 | 386 | cls.rorepo.git.clear_cache() | |
| 387 | 387 | cls.rorepo.git = None | |
| 388 | 388 | ||
| 389 | - def _make_file(self, relative_fpath, data, repo=None): | ||
| 389 | + def _make_file(self, relative_path, data, repo=None): | ||
| 390 | 390 | """ | |
| 391 | 391 | Create a file at the given path relative to our repository, filled with the | |
| 392 | 392 | given data. | |
| 393 | 393 | ||
| 394 | 394 | :return: An absolute path to the created file. | |
| 395 | 395 | """ | |
| 396 | 396 | repo = repo or self.rorepo | |
| 397 | - abs_path = osp.join(repo.working_tree_dir, relative_fpath) | ||
| 397 | + abs_path = osp.join(repo.working_tree_dir, relative_path) | ||
| 398 | 398 | with open(abs_path, "w") as fp: | |
| 399 | 399 | fp.write(data) | |
| 400 | 400 | return abs_path | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -32,7 +32,7 @@ class TestRefs(TestBase): | |||
| 32 | 32 | def test_from_path(self): | |
| 33 | 33 | # Should be able to create any reference directly. | |
| 34 | 34 | for ref_type in (Reference, Head, TagReference, RemoteReference): | |
| 35 | - for name in ("relative_fpath", "path/rela_name"): | ||
| 35 | + for name in ("relative_name", "path/rela_name"): | ||
| 36 | 36 | full_path = ref_type.to_full_path(name) | |
| 37 | 37 | instance = ref_type.from_path(self.rorepo, full_path) | |
| 38 | 38 | assert isinstance(instance, ref_type) | |
@@ -454,7 +454,7 @@ def test_head_reset(self, rw_repo): | |||
| 454 | 454 | ||
| 455 | 455 | # Rename it. | |
| 456 | 456 | orig_obj = ref.object | |
| 457 | - for name in ("refs/absname", "relative_fpath", "feature/rela_name"): | ||
| 457 | + for name in ("refs/absname", "relative_name", "feature/rela_name"): | ||
| 458 | 458 | ref_new_name = ref.rename(name) | |
| 459 | 459 | assert isinstance(ref_new_name, Reference) | |
| 460 | 460 | assert name in ref_new_name.path | |
| Back | FazBrowse Home | New Git URL |
0 commit comments