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

Commit08b0a91

Browse files
committed
Fix Repo.__repr__ when subclassed
1 parentf7cff58 commit08b0a91

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

‎git/repo/base.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1064,7 +1064,8 @@ def has_separate_working_tree(self):
10641064
rev_parse=rev_parse
10651065

10661066
def__repr__(self):
1067-
return'<git.Repo "%s">'%self.git_dir
1067+
clazz=self.__class__
1068+
return'<%s.%s %r>'% (clazz.__module__,clazz.__name__,self.git_dir)
10681069

10691070
defcurrently_rebasing_on(self):
10701071
"""

‎git/test/test_repo.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ def test_alternates(self):
362362
self.rorepo.alternates=cur_alternates
363363

364364
deftest_repr(self):
365-
assertrepr(self.rorepo).startswith('<git.Repo ')
365+
assertrepr(self.rorepo).startswith('<git.repo.base.Repo ')
366366

367367
deftest_is_dirty_with_bare_repository(self):
368368
orig_value=self.rorepo._bare

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp