X-Git-Url: http://git.scottworley.com/git-cache/blobdiff_plain/50685beba299ab4b601b6aabb013bb8398c8bfb0..d3b8a09dab31bd579466407aa9153219016eb45b:/git_cache.py diff --git a/git_cache.py b/git_cache.py index a34c329..8171b48 100644 --- a/git_cache.py +++ b/git_cache.py @@ -24,6 +24,11 @@ from typing import Iterator, NamedTuple, Optional, TypeVar, Tuple, Union import backoff + +class GitCacheError(Exception): + pass + + Path = str # eg: "/home/user/.cache/git-cache/v1" Repo = str # eg: "https://github.com/NixOS/nixpkgs.git" Ref = str # eg: "master" or "v1.0.0" @@ -85,7 +90,7 @@ def verify_ancestry( ancestor: RefOrRev, force: bool = False) -> None: if not force and not is_ancestor(repo, descendant, ancestor): - raise Exception(f'{ancestor} is not an ancestor of {descendant}') + raise GitCacheError(f'{ancestor} is not an ancestor of {descendant}') def _read_fetch_log(repo: Repo) -> Iterator[_LogEntry]: