Skip to content

Commit

Permalink
Merge pull request #1202 from nanonyme/nanonyme-patch-1
Browse files Browse the repository at this point in the history
Raise GitProtocolError on unexpected pkt
  • Loading branch information
jelmer authored Aug 26, 2023
2 parents 4af6b54 + 6322250 commit 98f303b
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion dulwich/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -413,7 +413,10 @@ def _read_shallow_updates(pkt_seq):
new_shallow = set()
new_unshallow = set()
for pkt in pkt_seq:
cmd, sha = pkt.split(b" ", 1)
try:
cmd, sha = pkt.split(b" ", 1)
except ValueError:
raise GitProtocolError("unknown command %s" % pkt)
if cmd == COMMAND_SHALLOW:
new_shallow.add(sha.strip())
elif cmd == COMMAND_UNSHALLOW:
Expand Down

0 comments on commit 98f303b

Please sign in to comment.