t5570: add tests for "git {clone,fetch,pull} -v"

Now that git_connect is more information about connectivity progress after: ("pass transport verbosity down to git_connect") we should ensure it remains so for future users who need to to diagnose networking problems. Signed-off-by: Eric Wong <normalperson@yhbt.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Eric Wong committed Feb 14, 2016 at 09:26 UTC 25bb90b10300fd7ede42e250e9b7c5b9f8a4fc15
1 file changed +20 -2
t/t5570-git-daemon.sh
+20 -2
@@ -6,6 +6,12 @@ test_description='test fetching over git protocol'
6 . "$TEST_DIRECTORY"/lib-git-daemon.sh
7 start_git_daemon
8
9 +check_verbose_connect () {
10 + grep -F "Looking up 127.0.0.1 ..." stderr &&
11 + grep -F "Connecting to 127.0.0.1 (port " stderr &&
12 + grep -F "done." stderr
13 +}
14 +
15 test_expect_success 'setup repository' '
16 git config push.default matching &&
17 echo content >file &&
@@ -24,7 +30,8 @@ test_expect_success 'create git-accessible bare repository' '
30 '
31
32 test_expect_success 'clone git repository' '
27 - git clone "$GIT_DAEMON_URL/repo.git" clone &&
33 + git clone -v "$GIT_DAEMON_URL/repo.git" clone 2>stderr &&
34 + check_verbose_connect &&
35 test_cmp file clone/file
36 '
37
@@ -32,10 +39,21 @@ test_expect_success 'fetch changes via git protocol' '
39 echo content >>file &&
40 git commit -a -m two &&
41 git push public &&
35 - (cd clone && git pull) &&
42 + (cd clone && git pull -v) 2>stderr &&
43 + check_verbose_connect &&
44 test_cmp file clone/file
45 '
46
47 +test_expect_success 'no-op fetch -v stderr is as expected' '
48 + (cd clone && git fetch -v) 2>stderr &&
49 + check_verbose_connect
50 +'
51 +
52 +test_expect_success 'no-op fetch without "-v" is quiet' '
53 + (cd clone && git fetch) 2>stderr &&
54 + ! test -s stderr
55 +'
56 +
57 test_expect_success 'remote detects correct HEAD' '
58 git push public master:other &&
59 (cd clone &&