فهرست منبع

Fix type annotation issue in dulwich/bisect.py

Jelmer Vernooij 5 ماه پیش
والد
کامیت
d4d5d8d46a
2فایلهای تغییر یافته به همراه3 افزوده شده و 2 حذف شده
  1. 2 1
      dulwich/bisect.py
  2. 1 1
      dulwich/merge.py

+ 2 - 1
dulwich/bisect.py

@@ -408,7 +408,8 @@ class BisectState:
         obj = self.repo.object_store[sha]
         if isinstance(obj, Commit):
             message = obj.message.decode("utf-8", errors="replace")
-            return message.split("\n")[0]
+            lines = message.split("\n")
+            return lines[0] if lines else ""
         return ""
 
     def _append_to_log(self, line: str) -> None:

+ 1 - 1
dulwich/merge.py

@@ -5,7 +5,7 @@ from typing import Optional
 try:
     import merge3
 except ImportError:
-    merge3 = None  # type: ignore
+    merge3 = None
 
 from dulwich.attrs import GitAttributes
 from dulwich.config import Config