From 69ae92bda13dfbf0b7d169c57b9f2715af2a9d67 Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Wed, 13 Oct 2010 11:36:36 -0700 Subject: [PATCH] shell portability: no "export VAR=VAL" MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit It is more portable to say "VAR=VAL && export VAR" instead. Noticed by Ævar. Signed-off-by: Junio C Hamano --- git-am.sh | 2 +- git-rebase.sh | 2 +- git-stash.sh | 2 +- t/t1509-root-worktree.sh | 28 ++++++++++++++-------------- t/t5560-http-backend-noserver.sh | 8 ++++---- t/t556x_common | 4 ++-- 6 files changed, 23 insertions(+), 23 deletions(-) diff --git a/git-am.sh b/git-am.sh index e7f008c7b..5f249485d 100755 --- a/git-am.sh +++ b/git-am.sh @@ -137,7 +137,7 @@ It does not apply to blobs recorded in its index." export GITHEAD_$his_tree if test -n "$GIT_QUIET" then - export GIT_MERGE_VERBOSITY=0 + GIT_MERGE_VERBOSITY=0 && export GIT_MERGE_VERBOSITY fi git-merge-recursive $orig_tree -- HEAD $his_tree || { git rerere $allow_rerere_autoupdate diff --git a/git-rebase.sh b/git-rebase.sh index 3335cee70..e5df23bb8 100755 --- a/git-rebase.sh +++ b/git-rebase.sh @@ -111,7 +111,7 @@ call_merge () { export GITHEAD_$cmt GITHEAD_$hd if test -n "$GIT_QUIET" then - export GIT_MERGE_VERBOSITY=1 + GIT_MERGE_VERBOSITY=1 && export GIT_MERGE_VERBOSITY fi eval 'git-merge-$strategy' $strategy_opts '"$cmt^" -- "$hd" "$cmt"' rv=$? diff --git a/git-stash.sh b/git-stash.sh index 5fb1245ea..7561b374d 100755 --- a/git-stash.sh +++ b/git-stash.sh @@ -373,7 +373,7 @@ apply_stash () { if test -n "$GIT_QUIET" then - export GIT_MERGE_VERBOSITY=0 + GIT_MERGE_VERBOSITY=0 && export GIT_MERGE_VERBOSITY fi if git merge-recursive $b_tree -- $c_tree $w_tree then diff --git a/t/t1509-root-worktree.sh b/t/t1509-root-worktree.sh index 7f60fd0b2..335420fd8 100755 --- a/t/t1509-root-worktree.sh +++ b/t/t1509-root-worktree.sh @@ -134,8 +134,8 @@ cat >ls.expected <act @@ -26,8 +26,8 @@ GET() { } POST() { - export REQUEST_METHOD="POST" && - export CONTENT_TYPE="application/x-$1-request" && + REQUEST_METHOD="POST" && export REQUEST_METHOD && + CONTENT_TYPE="application/x-$1-request" && export CONTENT_TYPE && run_backend "/repo.git/$1" "$2" && unset REQUEST_METHOD && unset CONTENT_TYPE && @@ -46,7 +46,7 @@ log_div() { . "$TEST_DIRECTORY"/t556x_common expect_aliased() { - export REQUEST_METHOD="GET" && + REQUEST_METHOD="GET" && export REQUEST_METHOD && if test $1 = 0; then run_backend "$2" else diff --git a/t/t556x_common b/t/t556x_common index be024e551..51287d89d 100755 --- a/t/t556x_common +++ b/t/t556x_common @@ -50,7 +50,7 @@ get_static_files() { } SMART=smart -export GIT_HTTP_EXPORT_ALL=1 +GIT_HTTP_EXPORT_ALL=1 && export GIT_HTTP_EXPORT_ALL test_expect_success 'direct refs/heads/master not found' ' log_div "refs/heads/master" GET refs/heads/master "404 Not Found" @@ -73,7 +73,7 @@ test_expect_success 'export if git-daemon-export-ok' ' get_static_files "200 OK" ' SMART=smart -export GIT_HTTP_EXPORT_ALL=1 +GIT_HTTP_EXPORT_ALL=1 && export GIT_HTTP_EXPORT_ALL test_expect_success 'static file if http.getanyfile true is ok' ' log_div "getanyfile true" config http.getanyfile true && -- 2.30.2