t / t5507-remote-environment.shon commit Merge branch 'master' of https://github.com/vnwildman/git (26a567e)
   1#!/bin/sh
   2
   3test_description='check environment showed to remote side of transports'
   4. ./test-lib.sh
   5
   6test_expect_success 'set up "remote" push situation' '
   7        test_commit one &&
   8        git config push.default current &&
   9        git init remote
  10'
  11
  12test_expect_success 'set up fake ssh' '
  13        GIT_SSH_COMMAND="f() {
  14                cd \"\$TRASH_DIRECTORY\" &&
  15                eval \"\$2\"
  16        }; f" &&
  17        export GIT_SSH_COMMAND &&
  18        export TRASH_DIRECTORY
  19'
  20
  21# due to receive.denyCurrentBranch=true
  22test_expect_success 'confirm default push fails' '
  23        test_must_fail git push remote
  24'
  25
  26test_expect_success 'config does not travel over same-machine push' '
  27        test_must_fail git -c receive.denyCurrentBranch=false push remote
  28'
  29
  30test_expect_success 'config does not travel over ssh push' '
  31        test_must_fail git -c receive.denyCurrentBranch=false push host:remote
  32'
  33
  34test_done