commit - e9f9d24c4d03f5f9a4c59601be2c992a2ef01be8
commit + c89cf2d3318a8247c1329a3ff976d5e7dae5e87b
blob - efb91733e233894cc4d72d26074a4dc108555920
blob + 853321cf35941e2fcc683ef2fb88743e064643a7
--- dulwich/server.py
+++ dulwich/server.py
import socket
import sys
import time
-from typing import List, Tuple, Dict, Optional, Iterable, Set
+from typing import List, Tuple, Dict, Optional, Iterable, Set, Protocol as TypingProtocol
import zlib
import socketserver
from dulwich.pack import (
write_pack_from_container,
ObjectContainer,
+ PackedObjectContainer,
)
from dulwich.protocol import (
BufferedPktLineWriter,
NAK_LINE,
)
from dulwich.refs import (
+ RefsContainer,
ANNOTATED_TAG_SUFFIX,
write_info_refs,
)
raise NotImplementedError(self.open_repository)
-class BackendRepo:
+class BackendRepo(TypingProtocol):
"""Repository abstraction used by the Git server.
The methods required here are a subset of those provided by
dulwich.repo.Repo.
"""
- object_store = None
- refs = None
+ object_store: PackedObjectContainer
+ refs: RefsContainer
def get_refs(self) -> Dict[bytes, bytes]:
"""