Skip to content

Commit

Permalink
Merge branch 'ew/connect-verbose'
Browse files Browse the repository at this point in the history
* ew/connect-verbose:
  t5570: add tests for "git {clone,fetch,pull} -v"
  • Loading branch information
Junio C Hamano committed Feb 22, 2016
2 parents d4bd678 + 25bb90b commit d7145ef
Showing 1 changed file with 20 additions and 2 deletions.
22 changes: 20 additions & 2 deletions t/t5570-git-daemon.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,12 @@ test_description='test fetching over git protocol'
. "$TEST_DIRECTORY"/lib-git-daemon.sh
start_git_daemon

check_verbose_connect () {
grep -F "Looking up 127.0.0.1 ..." stderr &&
grep -F "Connecting to 127.0.0.1 (port " stderr &&
grep -F "done." stderr
}

test_expect_success 'setup repository' '
git config push.default matching &&
echo content >file &&
Expand All @@ -24,18 +30,30 @@ test_expect_success 'create git-accessible bare repository' '
'

test_expect_success 'clone git repository' '
git clone "$GIT_DAEMON_URL/repo.git" clone &&
git clone -v "$GIT_DAEMON_URL/repo.git" clone 2>stderr &&
check_verbose_connect &&
test_cmp file clone/file
'

test_expect_success 'fetch changes via git protocol' '
echo content >>file &&
git commit -a -m two &&
git push public &&
(cd clone && git pull) &&
(cd clone && git pull -v) 2>stderr &&
check_verbose_connect &&
test_cmp file clone/file
'

test_expect_success 'no-op fetch -v stderr is as expected' '
(cd clone && git fetch -v) 2>stderr &&
check_verbose_connect
'

test_expect_success 'no-op fetch without "-v" is quiet' '
(cd clone && git fetch) 2>stderr &&
! test -s stderr
'

test_expect_success 'remote detects correct HEAD' '
git push public master:other &&
(cd clone &&
Expand Down

0 comments on commit d7145ef

Please sign in to comment.