From 25a96af6fbe6cf479b0154a4a8e6a220592f36dc Mon Sep 17 00:00:00 2001 From: Stephen Haberman Date: Mon, 23 Jun 2008 15:37:41 -0500 Subject: [PATCH] Handline new lines correctly. --- cbas/post-receive | 9 +++++---- cbas/pre-receive | 13 +++++++------ 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/cbas/post-receive b/cbas/post-receive index 0511475..19824c1 100755 --- a/cbas/post-receive +++ b/cbas/post-receive @@ -3,11 +3,12 @@ # Delegates to post-receive-email and post-receive-trac # +nl=$'\n' input="" -while read line ; do - input="$input$line" +while read newref oldref refname ; do + input="$input$newref $oldref $refname$nl" done -echo $input | sh /srv/git/hooks/server/post-receive-email -echo $input | sh /srv/git/hooks/server/post-receive-trac +echo -n "$input" | sh /srv/git/hooks/server/post-receive-email +echo -n "$input" | sh /srv/git/hooks/server/post-receive-trac diff --git a/cbas/pre-receive b/cbas/pre-receive index b9503f8..fa7e124 100755 --- a/cbas/pre-receive +++ b/cbas/pre-receive @@ -1,12 +1,13 @@ #!/bin/sh +nl=$'\n' input="" -while read line ; do - input="$input$line" +while read newref oldref refname ; do + input="$input$newref $oldref $refname$nl" done -echo $input | sh /srv/git/hooks/server/pre-receive-only-one && -echo $input | sh /srv/git/hooks/server/pre-receive-prefer-rebase && -echo $input | sh /srv/git/hooks/server/pre-receive-stable && -echo $input | sh /srv/git/hooks/server/pre-receive-trac +echo -n "$input" | sh /srv/git/hooks/server/pre-receive-only-one && +echo -n "$input" | sh /srv/git/hooks/server/pre-receive-prefer-rebase && +echo -n "$input" | sh /srv/git/hooks/server/pre-receive-stable && +echo -n "$input" | sh /srv/git/hooks/server/pre-receive-trac -- 2.39.5