From: Junio C Hamano Date: Tue, 22 Jul 2014 17:22:57 +0000 (-0700) Subject: Merge branch 'ep/shell-assign-and-export-vars' into maint X-Git-Tag: v2.0.3~17 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/63618af24a67e5fc959217201d9f220383a39fd0?ds=inline;hp=-c Merge branch 'ep/shell-assign-and-export-vars' into maint * ep/shell-assign-and-export-vars: scripts: more "export VAR=VALUE" fixes scripts: "export VAR=VALUE" construct is not portable --- 63618af24a67e5fc959217201d9f220383a39fd0 diff --combined git-remote-testgit.sh index 1c006a0518,cbf470f64f..a9c75a2360 --- a/git-remote-testgit.sh +++ b/git-remote-testgit.sh @@@ -13,10 -13,9 +13,11 @@@ refspec="${GIT_REMOTE_TESTGIT_REFSPEC-$ test -z "$refspec" && prefix="refs" - export GIT_DIR="$url/.git" + GIT_DIR="$url/.git" + export GIT_DIR +force= + mkdir -p "$dir" if test -z "$GIT_REMOTE_TESTGIT_NO_MARKS" @@@ -41,7 -40,6 +42,7 @@@ d fi test -n "$GIT_REMOTE_TESTGIT_SIGNED_TAGS" && echo "signed-tags" test -n "$GIT_REMOTE_TESTGIT_NO_PRIVATE_UPDATE" && echo "no-private-update" + echo 'option' echo ;; list) @@@ -96,7 -94,6 +97,7 @@@ before=$(git for-each-ref --format=' %(refname) %(objectname) ') git fast-import \ + ${force:+--force} \ ${testgitmarks:+"--import-marks=$testgitmarks"} \ ${testgitmarks:+"--export-marks=$testgitmarks"} \ --quiet @@@ -119,20 -116,6 +120,20 @@@ echo ;; + option\ *) + read cmd opt val <<-EOF + $line + EOF + case $opt in + force) + test $val = "true" && force="true" || force= + echo "ok" + ;; + *) + echo "unsupported" + ;; + esac + ;; '') exit ;; diff --combined git-stash.sh index 4798bcf0e5,fc3005a7a2..4621d81fab --- a/git-stash.sh +++ b/git-stash.sh @@@ -94,7 -94,8 +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) && @@@ -512,14 -513,8 +513,14 @@@ apply_stash () pop_stash() { assert_stash_ref "$@" - apply_stash "$@" && - drop_stash "$@" + if apply_stash "$@" + then + drop_stash "$@" + else + status=$? + say "The stash is kept in case you need it again." + exit $status + fi } drop_stash () { diff --combined t/t5560-http-backend-noserver.sh index 5abd11a563,1e25128ad3..aa73eeaef8 --- a/t/t5560-http-backend-noserver.sh +++ b/t/t5560-http-backend-noserver.sh @@@ -5,12 -5,16 +5,16 @@@ test_description='test git-http-backend 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" | - QUERY_STRING="${1#*\?}" \ - PATH_TRANSLATED="$HTTPD_DOCUMENT_ROOT_PATH/${1%%\?*}" \ + QUERY_STRING="${1#*[?]}" \ + PATH_TRANSLATED="$HTTPD_DOCUMENT_ROOT_PATH/${1%%[?]*}" \ git http-backend >act.out 2>act.err }