diff options
author | Ralf Jung <post@ralfj.de> | 2015-06-08 21:52:44 +0200 |
---|---|---|
committer | Ralf Jung <post@ralfj.de> | 2015-06-08 21:52:44 +0200 |
commit | b00245b2f024e01621a3f2ef11dcc6a1f62ce992 (patch) | |
tree | 0009a413148f5635b800c46a27fc492e3cb4f613 | |
parent | 8978aa1dcec412c9782d73e097ac864c903e0e2c (diff) |
githook: slightly more robust against weird input
-rwxr-xr-x | githook.py | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -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: |