@@ -449,8 +449,9 @@ def __init__(self, repo: 'Repo', name: str) -> None:
449
449
450
450
:param repo: The repository we are a remote of
451
451
:param name: the name of the remote, i.e. 'origin'"""
452
- self .repo = repo # type: 'Repo'
452
+ self .repo = repo
453
453
self .name = name
454
+ self .url : str
454
455
455
456
def __getattr__ (self , attr : str ) -> Any :
456
457
"""Allows to call this instance like
@@ -558,15 +559,7 @@ def delete_url(self, url: str, **kwargs: Any) -> 'Remote':
558
559
"""
559
560
return self .set_url (url , delete = True )
560
561
561
- @property
562
- def url (self ) -> Union [str , List [str ]]:
563
- url_list = list (self .urls )
564
- if len (url_list ) == 1 :
565
- return url_list [0 ]
566
- else :
567
- return url_list
568
-
569
- @property
562
+ @ property
570
563
def urls (self ) -> Iterator [str ]:
571
564
""":return: Iterator yielding all configured URL targets on a remote as strings"""
572
565
try :
@@ -599,7 +592,7 @@ def urls(self) -> Iterator[str]:
599
592
else :
600
593
raise ex
601
594
602
- @property
595
+ @ property
603
596
def refs (self ) -> IterableList [RemoteReference ]:
604
597
"""
605
598
:return:
@@ -610,7 +603,7 @@ def refs(self) -> IterableList[RemoteReference]:
610
603
out_refs .extend (RemoteReference .list_items (self .repo , remote = self .name ))
611
604
return out_refs
612
605
613
- @property
606
+ @ property
614
607
def stale_refs (self ) -> IterableList [Reference ]:
615
608
"""
616
609
:return:
@@ -644,7 +637,7 @@ def stale_refs(self) -> IterableList[Reference]:
644
637
# END for each line
645
638
return out_refs
646
639
647
- @classmethod
640
+ @ classmethod
648
641
def create (cls , repo : 'Repo' , name : str , url : str , ** kwargs : Any ) -> 'Remote' :
649
642
"""Create a new remote to the given repository
650
643
:param repo: Repository instance that is to receive the new remote
@@ -661,7 +654,7 @@ def create(cls, repo: 'Repo', name: str, url: str, **kwargs: Any) -> 'Remote':
661
654
# add is an alias
662
655
add = create
663
656
664
- @classmethod
657
+ @ classmethod
665
658
def remove (cls , repo : 'Repo' , name : str ) -> str :
666
659
"""Remove the remote with the given name
667
660
:return: the passed remote name to remove
0 commit comments