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

Disable merge_includes in config writers#1618

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

Merged
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
2 changes: 1 addition & 1 deletiongit/repo/base.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -600,7 +600,7 @@ def config_writer(self, config_level: Lit_config_levels = "repository") -> GitCo
system = system wide configuration file
global = user level configuration file
repository = configuration file for this repository only"""
return GitConfigParser(self._get_config_path(config_level), read_only=False, repo=self)
return GitConfigParser(self._get_config_path(config_level), read_only=False, repo=self, merge_includes=False)

def commit(self, rev: Union[str, Commit_ish, None] = None) -> Commit:
"""The Commit object for the specified revision
Expand Down
21 changes: 21 additions & 0 deletionstest/test_refs.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -15,6 +15,7 @@
SymbolicReference,
GitCommandError,
RefLog,
GitConfigParser,
)
from git.objects.tag import TagObject
from test.lib import TestBase, with_rw_repo
Expand DownExpand Up@@ -172,6 +173,26 @@ def test_heads(self, rwrepo):
assert log[0].oldhexsha == pcommit.NULL_HEX_SHA
assert log[0].newhexsha == pcommit.hexsha

@with_rw_repo("HEAD", bare=False)
def test_set_tracking_branch_with_import(self, rwrepo):
# prepare included config file
included_config = osp.join(rwrepo.git_dir, "config.include")
with GitConfigParser(included_config, read_only=False) as writer:
writer.set_value("test", "value", "test")
assert osp.exists(included_config)

with rwrepo.config_writer() as writer:
writer.set_value("include", "path", included_config)

for head in rwrepo.heads:
head.set_tracking_branch(None)
assert head.tracking_branch() is None
remote_ref = rwrepo.remotes[0].refs[0]
assert head.set_tracking_branch(remote_ref) is head
assert head.tracking_branch() == remote_ref
head.set_tracking_branch(None)
assert head.tracking_branch() is None

def test_refs(self):
types_found = set()
for ref in self.rorepo.refs:
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp