소스 검색

Fix type annotation issue in dulwich/patch.py

Jelmer Vernooij 5 달 전
부모
커밋
6495948670
1개의 변경된 파일2개의 추가작업 그리고 1개의 파일을 삭제
  1. 2 1
      dulwich/patch.py

+ 2 - 1
dulwich/patch.py

@@ -118,7 +118,8 @@ def get_summary(commit: "Commit") -> str:
     Returns: Summary string
     """
     decoded = commit.message.decode(errors="replace")
-    return decoded.splitlines()[0].replace(" ", "-")
+    lines = decoded.splitlines()
+    return lines[0].replace(" ", "-") if lines else ""
 
 
 #  Unified Diff