Skip to content

Commit

Permalink
typecheck: fix type error in _git_info
Browse files Browse the repository at this point in the history
  • Loading branch information
skshetry committed Nov 14, 2022
1 parent a753ee2 commit 87d8269
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions dvc/repo/data.py
Original file line number Diff line number Diff line change
@@ -12,17 +12,17 @@
Optional,
Tuple,
TypedDict,
Union,
cast,
)

from dvc.fs.git import GitFileSystem
from dvc.ui import ui

if TYPE_CHECKING:
from scmrepo.base import Base

from dvc.output import Output
from dvc.repo import Repo
from dvc.scm import Git, NoSCM
from dvc_data.hashfile.db import HashFileDB
from dvc_data.hashfile.hash_info import HashInfo
from dvc_data.hashfile.obj import HashFile
@@ -140,7 +140,9 @@ class GitInfo(TypedDict, total=False):
is_dirty: bool


def _git_info(scm: "Base", untracked_files: str = "all") -> GitInfo:
def _git_info(
scm: Union["Git", "NoSCM"], untracked_files: str = "all"
) -> GitInfo:
from scmrepo.exceptions import SCMError

from dvc.scm import NoSCM

0 comments on commit 87d8269

Please sign in to comment.