Procházet zdrojové kódy

Fix type annotation issue in dulwich/patch.py

Jelmer Vernooij před 5 měsíci
rodič
revize
6495948670
1 změnil soubory, kde provedl 2 přidání a 1 odebrání
  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