From 901b87dd77ae1bf3d9be8986f45035ea9e4e1632 Mon Sep 17 00:00:00 2001 From: Keegan McAllister Date: Wed, 3 Oct 2012 15:18:16 -0400 Subject: [PATCH] post-receive: Loop over all pushed refs (imported from commit 7f101732b3e521b9ef4a41204e0dbbba67f035f5) --- tools/post-receive | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/post-receive b/tools/post-receive index 063ce5c5c5..6fa450890d 100755 --- a/tools/post-receive +++ b/tools/post-receive @@ -34,13 +34,9 @@ def check_output(*popenargs, **kwargs): cmd = popenargs[0] raise subprocess.CalledProcessError(retcode, cmd, output=output) return output - subprocess.check_output = check_output -args = sys.stdin.read() -oldrev, newrev, refname = args.split() - -if refname in ["refs/heads/master", "refs/heads/test-post-receive"]: +def process_push(oldrev, newrev, refname): subprocess.check_call(["ssh", "app.humbughq.com", "--", "env", "-u", "GIT_DIR", "/home/humbug/humbug/tools/update-deployment", oldrev, newrev, refname]) @@ -53,3 +49,8 @@ if refname in ["refs/heads/master", "refs/heads/test-post-receive"]: "recipient": "tabbott@humbughq.com", } client.send_message(message_data) + +for ln in sys.stdin: + oldrev, newrev, refname = ln.strip().split() + if refname in ["refs/heads/master", "refs/heads/test-post-receive"]: + process_push(oldrev, newrev, refname)