Parcourir la source

Pass remote errors on as separate exception.

Brendan Cully il y a 14 ans
Parent
commit
eb0df72f94
1 fichiers modifiés avec 3 ajouts et 0 suppressions
  1. 3 0
      dulwich/client.py

+ 3 - 0
dulwich/client.py

@@ -26,6 +26,7 @@ import socket
 import urlparse
 
 from dulwich.errors import (
+    GitProtocolError,
     SendPackError,
     UpdateRefsError,
     )
@@ -95,6 +96,8 @@ class GitClient(object):
         # Receive refs from server
         for pkt in proto.read_pkt_seq():
             (sha, ref) = pkt.rstrip('\n').split(' ', 1)
+            if sha == 'ERR':
+                raise GitProtocolError(ref)
             if server_capabilities is None:
                 (ref, server_capabilities) = extract_capabilities(ref)
             refs[ref] = sha