commit f108d03fa12f3a69e0839fb366bd9eff71dfc9d2 from: Jelmer Vernooij via: Jelmer Vernooij date: Mon Oct 14 23:04:50 2024 UTC Fix typing error from mypy commit - cd0ec49d745b8cd3de2170795a4131267161230f commit + f108d03fa12f3a69e0839fb366bd9eff71dfc9d2 blob - f9eb79992473cc7479ecb8059acbb64a20559a54 blob + 016e70b7f508d521cca802883b38da50f1c59c20 --- dulwich/refs.py +++ dulwich/refs.py @@ -24,7 +24,7 @@ import os import warnings from contextlib import suppress -from typing import Any, Dict, Optional, Set +from typing import Any, Dict, Optional, Set, List, Tuple from .errors import PackedRefsException, RefFormatError from .file import GitFile, ensure_dir_exists @@ -53,7 +53,7 @@ class SymrefLoop(Exception): self.depth = depth -def parse_symref_value(contents): +def parse_symref_value(contents: bytes) -> bytes: """Parse a symref value. Args: @@ -291,7 +291,7 @@ class RefsContainer: """ raise NotImplementedError(self.read_loose_ref) - def follow(self, name): + def follow(self, name) -> Tuple[List[bytes], bytes]: """Follow a reference name. Returns: a tuple of (refnames, sha), wheres refnames are the names of @@ -1188,7 +1188,7 @@ def _set_origin_head(refs, origin, origin_head): def _set_default_branch( refs: RefsContainer, origin: bytes, - origin_head: bytes, + origin_head: Optional[bytes], branch: bytes, ref_message: Optional[bytes], ) -> bytes: