Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Handle relativeinclude.path when root config is provided as a relative path#2104

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
Copilot wants to merge2 commits intomain
base:main
Choose a base branch
Loading
fromcopilot/test-and-fix-issue-2103
Draft
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletiongit/config.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -661,7 +661,8 @@ def read(self) -> None: # type: ignore[override]
continue
# END ignore relative paths if we don't know the configuration file path
file_path = cast(PathLike, file_path)
assert osp.isabs(file_path), "Need absolute paths to be sure our cycle checks will work"
if not osp.isabs(file_path):
file_path = osp.abspath(file_path)
include_path = osp.join(osp.dirname(file_path), include_path)
# END make include path absolute
include_path = osp.normpath(include_path)
Expand Down
11 changes: 11 additions & 0 deletionstest/test_config.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -246,6 +246,17 @@ def check_test_value(cr, value):
with GitConfigParser(fpa, read_only=True) as cr:
check_test_value(cr, tv)

@with_rw_directory
def test_relative_include_with_relative_config_path(self, rw_dir):
fpa = osp.join(rw_dir, "a")
fpb = osp.join(rw_dir, "b")
with GitConfigParser(fpb, read_only=False) as cw:
cw.set_value("b", "value", "b")
with GitConfigParser(fpa, read_only=False) as cw:
cw.set_value("include", "path", "b")
with GitConfigParser(osp.relpath(fpa), read_only=True) as cr:
assert cr.get_value("b", "value") == "b"

@with_rw_directory
def test_multiple_include_paths_with_same_key(self, rw_dir):
"""Test that multiple 'path' entries under [include] are all respected.
Expand Down

[8]ページ先頭

©2009-2026 Movatter.jp