RE: [PATCH 4/7] test-hg.sh: eliminate 'local' bashism

2013-11-11 Thread Felipe Contreras
Richard Hansen wrote:
 Unlike bash, POSIX shell does not specify a 'local' command for
 declaring function-local variable scope.  Except for IFS, the variable
 names are not used anywhere else in the script so simply remove the
 'local'.  For IFS, move the assignment to the 'read' command to
 prevent it from affecting code outside the function.

Makes sense.

-- 
Felipe Contreras
--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 4/7] test-hg.sh: eliminate 'local' bashism

2013-11-10 Thread Richard Hansen
Unlike bash, POSIX shell does not specify a 'local' command for
declaring function-local variable scope.  Except for IFS, the variable
names are not used anywhere else in the script so simply remove the
'local'.  For IFS, move the assignment to the 'read' command to
prevent it from affecting code outside the function.

Signed-off-by: Richard Hansen rhan...@bbn.com
---
 contrib/remote-helpers/test-hg.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/contrib/remote-helpers/test-hg.sh 
b/contrib/remote-helpers/test-hg.sh
index 53f2bba..558a656 100755
--- a/contrib/remote-helpers/test-hg.sh
+++ b/contrib/remote-helpers/test-hg.sh
@@ -54,14 +54,14 @@ check_bookmark () {
 }
 
 check_push () {
-   local expected_ret=$1 ret=0 ref_ret=0 IFS=':'
+   expected_ret=$1 ret=0 ref_ret=0
 
shift
git push origin $@ 2error
ret=$?
cat error
 
-   while read branch kind
+   while IFS=':' read branch kind
do
case $kind in
'new')
-- 
1.8.5.rc1.207.gc17dd22

--
To unsubscribe from this list: send the line unsubscribe git in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html