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

Commit89df641

Browse files
delego-wlritchiByron
authored andcommitted
Respect _common_dir when finding repository config file
Among other things, remotes are now correctly identified when in aseparate worktree.
1 parenta8591a0 commit89df641

File tree

3 files changed

+7
-1
lines changed

3 files changed

+7
-1
lines changed

‎AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,6 @@ Contributors are:
2727
-Charles Bouchard-Légaré <cblegare.atl _at_ ntis.ca>
2828
-Yaroslav Halchenko <debian _at_ onerussian.com>
2929
-Tim Swast <swast _at_ google.com>
30+
-William Luc Ritchie
3031

3132
Portions derived from other open source works and are clearly marked.

‎git/repo/base.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ def _get_config_path(self, config_level):
416416
elifconfig_level=="global":
417417
returnosp.normpath(osp.expanduser("~/.gitconfig"))
418418
elifconfig_level=="repository":
419-
returnosp.normpath(osp.join(self.git_dir,"config"))
419+
returnosp.normpath(osp.join(self._common_dirorself.git_dir,"config"))
420420

421421
raiseValueError("Invalid configuration level: %r"%config_level)
422422

‎git/test/test_repo.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -974,6 +974,11 @@ def test_git_work_tree_dotgit(self, rw_dir):
974974
commit=repo.head.commit
975975
self.assertIsInstance(commit,Object)
976976

977+
# this ensures we can read the remotes, which confirms we're reading
978+
# the config correctly.
979+
origin=repo.remotes.origin
980+
self.assertIsInstance(origin,Remote)
981+
977982
self.assertIsInstance(repo.heads['aaaaaaaa'],Head)
978983

979984
@with_rw_directory

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp