From b00245b2f024e01621a3f2ef11dcc6a1f62ce992 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Mon, 8 Jun 2015 21:52:44 +0200 Subject: [PATCH 1/1] githook: slightly more robust against weird input --- githook.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/githook.py b/githook.py index 47a87e9..5dd8497 100755 --- a/githook.py +++ b/githook.py @@ -41,7 +41,10 @@ if __name__ == "__main__": repo = repos[reponame] # parse the information we get from stdin. we trust this information. for line in sys.stdin: - (oldsha, newsha, ref) = line.split() + line = line.split() + if len(line) == 0: continue + assert len(line) == 3 + (oldsha, newsha, ref) = line repo.update_mirrors(ref, oldsha, newsha) except Exception as e: if repo is not None: -- 2.30.2