From bed137d2d55a3b5cbd642b1e80cd7bd9094db8d4 Mon Sep 17 00:00:00 2001 From: Elia Pinto Date: Fri, 23 May 2014 03:15:31 -0700 Subject: scripts: "export VAR=VALUE" construct is not portable Found by check-non-portable-shell.pl Signed-off-by: Elia Pinto Reviewed-by: Jonathan Nieder Signed-off-by: Junio C Hamano diff --git a/contrib/subtree/t/t7900-subtree.sh b/contrib/subtree/t/t7900-subtree.sh index 66ce4b0..8dc6840 100755 --- a/contrib/subtree/t/t7900-subtree.sh +++ b/contrib/subtree/t/t7900-subtree.sh @@ -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 diff --git a/git-remote-testgit.sh b/git-remote-testgit.sh index 6d2f282..cbf470f 100755 --- a/git-remote-testgit.sh +++ b/git-remote-testgit.sh @@ -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" diff --git a/git-stash.sh b/git-stash.sh index f0a94ab..fc3005a 100755 --- a/git-stash.sh +++ b/git-stash.sh @@ -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) && -- cgit v0.10.2-6-g49f6 From c1cebcf4314a8f18ec06e6d10ce39f49a59076ec Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Fri, 23 May 2014 11:19:34 -0700 Subject: scripts: more "export VAR=VALUE" fixes Found by git grep '[^-]export [^&]*=' -- \*.sh Signed-off-by: Junio C Hamano diff --git a/t/t3032-merge-recursive-options.sh b/t/t3032-merge-recursive-options.sh index 5fd7bbb..4029c9c 100755 --- a/t/t3032-merge-recursive-options.sh +++ b/t/t3032-merge-recursive-options.sh @@ -14,7 +14,11 @@ test_description='merge-recursive options . ./test-lib.sh test_have_prereq SED_STRIPS_CR && SED_OPTIONS=-b -test_have_prereq GREP_STRIPS_CR && export GREP_OPTIONS=-U +if test_have_prereq GREP_STRIPS_CR +then + GREP_OPTIONS=-U + export GREP_OPTIONS +fi test_expect_success 'setup' ' conflict_hunks () { diff --git a/t/t5560-http-backend-noserver.sh b/t/t5560-http-backend-noserver.sh index 9be9ae3..1e25128 100755 --- a/t/t5560-http-backend-noserver.sh +++ b/t/t5560-http-backend-noserver.sh @@ -5,7 +5,11 @@ test_description='test git-http-backend-noserver' HTTPD_DOCUMENT_ROOT_PATH="$TRASH_DIRECTORY" -test_have_prereq GREP_STRIPS_CR && export GREP_OPTIONS=-U +if test_have_prereq GREP_STRIPS_CR +then + GREP_OPTIONS=-U + export GREP_OPTIONS +fi run_backend() { echo "$2" | -- cgit v0.10.2-6-g49f6