Skip to content

Commit 0451fdd

Browse files
committed
update
1 parent 94e82e1 commit 0451fdd

File tree

5 files changed

+14
-14
lines changed

5 files changed

+14
-14
lines changed

git/objects/submodule/base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -416,11 +416,11 @@ def _write_git_file_and_module_config(cls, working_tree_dir: PathLike, module_ab
416416
Absolute path to the bare repository.
417417
"""
418418
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)
420420
if sys.platform == "win32" and osp.isfile(git_file):
421421
os.remove(git_file)
422422
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))
424424

425425
with GitConfigParser(osp.join(module_abspath, "config"), read_only=False, merge_includes=False) as writer:
426426
writer.set_value(

git/objects/util.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -568,11 +568,11 @@ def addToStack(
568568
yield rval
569569

570570
# 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:
573573
continue
574574

575-
addToStack(stack, item, branch_first, nb)
575+
addToStack(stack, item, branch_first, next_depth)
576576
# END for each item on work stack
577577

578578

git/refs/symbolic.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ def _get_ref_info(cls, repo: "Repo", ref_path: Union[PathLike, None]) -> Union[T
272272
:return:
273273
*(str(sha), str(target_ref_path))*, where:
274274
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``.
276276
* *target_ref_path* is the reference we point to, or ``None``.
277277
"""
278278
return cls._get_ref_info_helper(repo, ref_path)
@@ -813,7 +813,7 @@ def _iter_items(
813813
) -> Iterator[T_References]:
814814
if common_path is None:
815815
common_path = cls._common_path_default
816-
relative_fpaths = set()
816+
relative_paths = set()
817817

818818
# Walk loose refs.
819819
# Currently we do not follow links.
@@ -828,19 +828,19 @@ def _iter_items(
828828
if f == "packed-refs":
829829
continue
830830
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) + "/", ""))
832832
# END for each file in root directory
833833
# END for each directory to walk
834834

835835
# Read packed refs.
836836
for _sha, relative_fpath in cls._iter_packed_refs(repo):
837837
if relative_fpath.startswith(str(common_path)):
838-
relative_fpaths.add(relative_fpath)
838+
relative_paths.add(relative_fpath)
839839
# END relative path matches common path
840840
# END packed refs reading
841841

842842
# Yield paths in sorted order.
843-
for path in sorted(relative_fpaths):
843+
for path in sorted(relative_paths):
844844
try:
845845
yield cls.from_path(repo, path)
846846
except ValueError:

test/lib/helper.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -386,15 +386,15 @@ def tearDownClass(cls):
386386
cls.rorepo.git.clear_cache()
387387
cls.rorepo.git = None
388388

389-
def _make_file(self, relative_fpath, data, repo=None):
389+
def _make_file(self, relative_path, data, repo=None):
390390
"""
391391
Create a file at the given path relative to our repository, filled with the
392392
given data.
393393
394394
:return: An absolute path to the created file.
395395
"""
396396
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)
398398
with open(abs_path, "w") as fp:
399399
fp.write(data)
400400
return abs_path

test/test_refs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ class TestRefs(TestBase):
3232
def test_from_path(self):
3333
# Should be able to create any reference directly.
3434
for ref_type in (Reference, Head, TagReference, RemoteReference):
35-
for name in ("relative_fpath", "path/rela_name"):
35+
for name in ("relative_path", "path/rela_name"):
3636
full_path = ref_type.to_full_path(name)
3737
instance = ref_type.from_path(self.rorepo, full_path)
3838
assert isinstance(instance, ref_type)
@@ -454,7 +454,7 @@ def test_head_reset(self, rw_repo):
454454

455455
# Rename it.
456456
orig_obj = ref.object
457-
for name in ("refs/absname", "relative_fpath", "feature/rela_name"):
457+
for name in ("refs/absname", "relative_path", "feature/rela_name"):
458458
ref_new_name = ref.rename(name)
459459
assert isinstance(ref_new_name, Reference)
460460
assert name in ref_new_name.path

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy