Skip to content

Commit

Permalink
Remove obsolete line dealing with singleton str arguments to Repo.get…
Browse files Browse the repository at this point in the history
…_walker

Fixes #1075
  • Loading branch information
jelmer committed Oct 22, 2022
1 parent 2ea0609 commit 260a6d9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
16 changes: 9 additions & 7 deletions dulwich/refs.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,12 +34,14 @@
valid_hexsha,
ZERO_SHA,
Tag,
ObjectID,
)
from dulwich.file import (
GitFile,
ensure_dir_exists,
)

Ref = bytes

HEADREF = b"HEAD"
SYMREF = b"ref: "
Expand Down Expand Up @@ -69,7 +71,7 @@ def parse_symref_value(contents):
raise ValueError(contents)


def check_ref_format(refname):
def check_ref_format(refname: Ref):
"""Check if a refname is correctly formatted.
Implements all the same rules as git-check-ref-format[1].
Expand Down Expand Up @@ -166,8 +168,8 @@ def get_peeled(self, name):

def import_refs(
self,
base: bytes,
other: Dict[bytes, bytes],
base: Ref,
other: Dict[Ref, ObjectID],
committer: Optional[bytes] = None,
timestamp: Optional[bytes] = None,
timezone: Optional[bytes] = None,
Expand Down Expand Up @@ -455,8 +457,8 @@ def _notify(self, ref, newsha):

def set_symbolic_ref(
self,
name,
other,
name: Ref,
other: Ref,
committer=None,
timestamp=None,
timezone=None,
Expand Down Expand Up @@ -507,8 +509,8 @@ def set_if_equals(

def add_if_new(
self,
name: bytes,
ref: bytes,
name: Ref,
ref: ObjectID,
committer=None,
timestamp=None,
timezone=None,
Expand Down
5 changes: 2 additions & 3 deletions dulwich/repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -741,7 +741,8 @@ def get_peeled(self, ref):
return cached
return self.object_store.peel_sha(self.refs[ref]).id

def get_walker(self, include=None, *args, **kwargs):
def get_walker(self, include: Optional[List[bytes]] = None,
*args, **kwargs):
"""Obtain a walker for this repository.
Args:
Expand Down Expand Up @@ -771,8 +772,6 @@ def get_walker(self, include=None, *args, **kwargs):

if include is None:
include = [self.head()]
if isinstance(include, str):
include = [include]

kwargs["get_parents"] = lambda commit: self.get_parents(commit.id, commit)

Expand Down

0 comments on commit 260a6d9

Please sign in to comment.