From mboxrd@z Thu Jan 1 00:00:00 1970 From: Richard Hansen Subject: [PATCH v2 5/9] test-hg.sh: eliminate 'local' bashism Date: Tue, 12 Nov 2013 00:54:44 -0500 Message-ID: <1384235688-9655-6-git-send-email-rhansen@bbn.com> References: <1384142712-2936-1-git-send-email-rhansen@bbn.com> <1384235688-9655-1-git-send-email-rhansen@bbn.com> Cc: felipe.contreras@gmail.com, Richard Hansen To: git@vger.kernel.org X-From: git-owner@vger.kernel.org Tue Nov 12 06:55:49 2013 Return-path: Envelope-to: gcvg-git-2@plane.gmane.org Received: from vger.kernel.org ([209.132.180.67]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Vg6wy-0000SH-AX for gcvg-git-2@plane.gmane.org; Tue, 12 Nov 2013 06:55:44 +0100 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752013Ab3KLFzY (ORCPT ); Tue, 12 Nov 2013 00:55:24 -0500 Received: from smtp.bbn.com ([128.33.0.80]:35976 "EHLO smtp.bbn.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751564Ab3KLFzP (ORCPT ); Tue, 12 Nov 2013 00:55:15 -0500 Received: from socket.bbn.com ([192.1.120.102]:57711) by smtp.bbn.com with esmtps (TLSv1:AES256-SHA:256) (Exim 4.77 (FreeBSD)) (envelope-from ) id 1Vg6wU-000LqA-Gm; Tue, 12 Nov 2013 00:55:14 -0500 X-Submitted: to socket.bbn.com (Postfix) with ESMTPSA id C7A124004D X-Mailer: git-send-email 1.8.5.rc1.208.g8ff7964 In-Reply-To: <1384235688-9655-1-git-send-email-rhansen@bbn.com> Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Archived-At: 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 --- 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 fa7d17b..ceef6b1 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 "$@" 2>error ret=$? cat error - while read branch kind + while IFS=':' read branch kind do case "$kind" in 'new') -- 1.8.5.rc1.208.g8ff7964