Merge branch 'ep/shell-assign-and-export-vars' into maint
authorJunio C Hamano <gitster@pobox.com>
Tue, 22 Jul 2014 17:22:57 +0000 (10:22 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 22 Jul 2014 17:22:57 +0000 (10:22 -0700)
* ep/shell-assign-and-export-vars:
scripts: more "export VAR=VALUE" fixes
scripts: "export VAR=VALUE" construct is not portable

1  2 
git-remote-testgit.sh
git-stash.sh
t/t5560-http-backend-noserver.sh
diff --combined git-remote-testgit.sh
index 1c006a0518e247d58759df98602f6dae3935caf6,cbf470f64f0b93c520ce55d1b93c866b669bfbaa..a9c75a2360fec7a9ce5f22877a471f70bc405ff1
@@@ -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
  
                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 4798bcf0e51b705005215e9a6339310defe16d03,fc3005a7a2453ebd37c7efee4a082e3655037603..4621d81fab472310e1183c1b9914644259a911e8
@@@ -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 () {
index 5abd11a5638299f2d3fe41d38f9a3d10050a4e4b,1e25128ad30c0134313da151bae81ef32485d0dc..aa73eeaef82adff56083fdc2d5d35d599b73edee
@@@ -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
  }