X-Git-Url: http://git.scottworley.com/git-cache/blobdiff_plain/3bd7fafb73314e630f46ed958b0ab9749c85827c..a3835f508d4a441c64156d4669378e080064d4bf:/git_cache.py?ds=sidebyside 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]: