Merge branch 'cb/maint-t5541-make-server-port-portable'
authorJunio C Hamano <gitster@pobox.com>
Mon, 20 Feb 2012 08:14:46 +0000 (00:14 -0800)
committerJunio C Hamano <gitster@pobox.com>
Mon, 20 Feb 2012 08:14:46 +0000 (00:14 -0800)
* cb/maint-t5541-make-server-port-portable:
t5541: check error message against the real port number used

1  2 
t/t5541-http-push.sh
diff --combined t/t5541-http-push.sh
index d66ed2450854c3091105a43bb2aa0f831140ed1f,da0b7026399929d388c43426a7ba6145ba9768c4..cc6f081711002b42bcf6b2cb26287dcc56852a06
@@@ -14,7 -14,6 +14,7 @@@ f
  ROOT_PATH="$PWD"
  LIB_HTTPD_PORT=${LIB_HTTPD_PORT-'5541'}
  . "$TEST_DIRECTORY"/lib-httpd.sh
 +. "$TEST_DIRECTORY"/lib-terminal.sh
  start_httpd
  
  test_expect_success 'setup remote repository' '
@@@ -106,7 -105,7 +106,7 @@@ cat >exp <<EO
  remote: error: hook declined to update refs/heads/dev2
  To http://127.0.0.1:$LIB_HTTPD_PORT/smart/test_repo.git
   ! [remote rejected] dev2 -> dev2 (hook declined)
- error: failed to push some refs to 'http://127.0.0.1:5541/smart/test_repo.git'
+ error: failed to push some refs to 'http://127.0.0.1:$LIB_HTTPD_PORT/smart/test_repo.git'
  EOF
  
  test_expect_success 'rejected update prints status' '
@@@ -183,44 -182,5 +183,44 @@@ test_expect_success 'push (chunked)' 
         test $HEAD = $(git rev-parse --verify HEAD))
  '
  
 +test_expect_success 'push --all can push to empty repo' '
 +      d=$HTTPD_DOCUMENT_ROOT_PATH/empty-all.git &&
 +      git init --bare "$d" &&
 +      git --git-dir="$d" config http.receivepack true &&
 +      git push --all "$HTTPD_URL"/smart/empty-all.git
 +'
 +
 +test_expect_success 'push --mirror can push to empty repo' '
 +      d=$HTTPD_DOCUMENT_ROOT_PATH/empty-mirror.git &&
 +      git init --bare "$d" &&
 +      git --git-dir="$d" config http.receivepack true &&
 +      git push --mirror "$HTTPD_URL"/smart/empty-mirror.git
 +'
 +
 +test_expect_success 'push --all to repo with alternates' '
 +      s=$HTTPD_DOCUMENT_ROOT_PATH/test_repo.git &&
 +      d=$HTTPD_DOCUMENT_ROOT_PATH/alternates-all.git &&
 +      git clone --bare --shared "$s" "$d" &&
 +      git --git-dir="$d" config http.receivepack true &&
 +      git --git-dir="$d" repack -adl &&
 +      git push --all "$HTTPD_URL"/smart/alternates-all.git
 +'
 +
 +test_expect_success 'push --mirror to repo with alternates' '
 +      s=$HTTPD_DOCUMENT_ROOT_PATH/test_repo.git &&
 +      d=$HTTPD_DOCUMENT_ROOT_PATH/alternates-mirror.git &&
 +      git clone --bare --shared "$s" "$d" &&
 +      git --git-dir="$d" config http.receivepack true &&
 +      git --git-dir="$d" repack -adl &&
 +      git push --mirror "$HTTPD_URL"/smart/alternates-mirror.git
 +'
 +
 +test_expect_success TTY 'quiet push' '
 +      cd "$ROOT_PATH"/test_repo_clone &&
 +      test_commit quiet &&
 +      test_terminal git push --quiet --no-progress 2>&1 | tee output &&
 +      test_cmp /dev/null output
 +'
 +
  stop_httpd
  test_done