From 08b0a91d8f83b96c8fb27273661621b4dc5a6c7f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Mat=C4=9Bjka?= Date: Fri, 13 Dec 2019 17:22:49 +0100 Subject: [PATCH] Fix Repo.__repr__ when subclassed --- git/repo/base.py | 3 ++- git/test/test_repo.py | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/git/repo/base.py b/git/repo/base.py index 05c55eddb..2c90e68cd 100644 --- a/git/repo/base.py +++ b/git/repo/base.py @@ -1064,7 +1064,8 @@ def has_separate_working_tree(self): rev_parse = rev_parse def __repr__(self): - return '' % self.git_dir + clazz = self.__class__ + return '<%s.%s %r>' % (clazz.__module__, clazz.__name__, self.git_dir) def currently_rebasing_on(self): """ diff --git a/git/test/test_repo.py b/git/test/test_repo.py index ef28c74ec..6ac20bb70 100644 --- a/git/test/test_repo.py +++ b/git/test/test_repo.py @@ -362,7 +362,7 @@ def test_alternates(self): self.rorepo.alternates = cur_alternates def test_repr(self): - assert repr(self.rorepo).startswith('