]> git.droids-corp.org - git-central.git/commitdiff
Handline new lines correctly.
authorStephen Haberman <shaberman@payflex.com>
Mon, 23 Jun 2008 20:37:41 +0000 (15:37 -0500)
committerStephen Haberman <shaberman@payflex.com>
Mon, 23 Jun 2008 20:37:41 +0000 (15:37 -0500)
cbas/post-receive
cbas/pre-receive

index 0511475bd35a873417f092d18acd4b7cd76fc743..19824c1638ab59eaa9c67fc8db15d812e25ea10f 100755 (executable)
@@ -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
 
index b9503f838accaacbed00a4bf7303e4ca61bcb5ce..fa7e12413012ffe474d129c8215fcd252d8ff3c6 100755 (executable)
@@ -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