diff options
-rw-r--r-- | git/diff.py | 2 | ||||
-rw-r--r-- | git/remote.py | 8 |
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: |