summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYobmod <yobmod@gmail.com>2021-07-09 15:49:32 +0100
committerYobmod <yobmod@gmail.com>2021-07-09 15:49:32 +0100
commite7b685db1bf4d9d6aa3f95f4df3fda5992dab14c (patch)
treea61d1565a93ab1598a9b58ac2ce2f19af15fb103
parentf916c148ea956655837a98817778abe685bf7ee7 (diff)
downloadgitpython-e7b685db1bf4d9d6aa3f95f4df3fda5992dab14c.tar.gz
Rmv Diffable assert, add Remoote.url property
-rw-r--r--git/diff.py2
-rw-r--r--git/remote.py8
2 files changed, 8 insertions, 2 deletions
diff --git a/git/diff.py b/git/diff.py
index 4024776d..1e2ee740 100644
--- a/git/diff.py
+++ b/git/diff.py
@@ -143,8 +143,6 @@ class Diffable(object):
if hasattr(self, 'Has_Repo'):
self.repo: Repo = self.repo
- else:
- raise AttributeError("No repo member found, cannot create DiffIndex")
diff_cmd = self.repo.git.diff
if other is self.Index:
diff --git a/git/remote.py b/git/remote.py
index 2998b987..3c3d3c48 100644
--- a/git/remote.py
+++ b/git/remote.py
@@ -559,6 +559,14 @@ class Remote(LazyMixin, IterableObj):
return self.set_url(url, delete=True)
@property
+ def url(self) -> Union[str, List[str]]:
+ url_list = list(self.urls)
+ if len(url_list) == 1:
+ return url_list[0]
+ else:
+ return url_list
+
+ @property
def urls(self) -> Iterator[str]:
""":return: Iterator yielding all configured URL targets on a remote as strings"""
try: