Skip to content

Commit 6ec0957

Browse files
committed
chore(project.git): Typings for GitProject.remotes
1 parent f1480d3 commit 6ec0957

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

libvcs/projects/git.py

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
import logging
1919
import pathlib
2020
import re
21-
from typing import Dict, Optional, TypedDict, Union
21+
import typing
22+
from typing import Dict, Literal, Optional, TypedDict, Union
2223
from urllib import parse as urlparse
2324

2425
from libvcs.types import StrPath
@@ -494,7 +495,17 @@ def update_repo(self, set_remotes: bool = False, *args, **kwargs):
494495
cmd = ["submodule", "update", "--recursive", "--init"]
495496
self.run(cmd, log_in_real_time=True)
496497

497-
def remotes(self, flat=False) -> Dict:
498+
@typing.overload
499+
def remotes(self, flat: Literal[False] = ...):
500+
...
501+
502+
@typing.overload
503+
def remotes(self, flat: Literal[True] = ...) -> GitFullRemoteDict:
504+
...
505+
506+
def remotes(
507+
self, flat: bool = False
508+
) -> Union[GitProjectRemoteDict, GitFullRemoteDict]:
498509
"""Return remotes like git remote -v.
499510
500511
Parameters

0 commit comments

Comments
 (0)