scripts: "export VAR=VALUE" construct is not portable
authorElia Pinto <gitter.spiros@gmail.com>
Fri, 23 May 2014 10:15:31 +0000 (03:15 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 23 May 2014 22:32:33 +0000 (15:32 -0700)
Found by check-non-portable-shell.pl

Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/subtree/t/t7900-subtree.sh
git-remote-testgit.sh
git-stash.sh
index 66ce4b07c2dc2d2d56dc260883f86d8672d2ac69..8dc684035318c86516860cb70eef987881f3899f 100755 (executable)
@@ -8,7 +8,8 @@ This test verifies the basic operation of the merge, pull, add
 and split subcommands of git subtree.
 '
 
-export TEST_DIRECTORY=$(pwd)/../../../t
+TEST_DIRECTORY=$(pwd)/../../../t
+export TEST_DIRECTORY
 
 . ../../../t/test-lib.sh
 
index 6d2f282d32212b605a1237bae224ecbba05cacd1..cbf470f64f0b93c520ce55d1b93c866b669bfbaa 100755 (executable)
@@ -13,7 +13,8 @@ refspec="${GIT_REMOTE_TESTGIT_REFSPEC-$default_refspec}"
 
 test -z "$refspec" && prefix="refs"
 
-export GIT_DIR="$url/.git"
+GIT_DIR="$url/.git"
+export GIT_DIR
 
 mkdir -p "$dir"
 
index f0a94abf1434c65d27caf4cd674f89de62e9333c..fc3005a7a2453ebd37c7efee4a082e3655037603 100755 (executable)
@@ -94,7 +94,8 @@ create_stash () {
                # ease of unpacking later.
                u_commit=$(
                        untracked_files | (
-                               export GIT_INDEX_FILE="$TMPindex"
+                               GIT_INDEX_FILE="$TMPindex" &&
+                               export GIT_INDEX_FILE &&
                                rm -f "$TMPindex" &&
                                git update-index -z --add --remove --stdin &&
                                u_tree=$(git write-tree) &&