summaryrefslogtreecommitdiff
path: root/t/t5570-git-daemon.sh
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2016-02-14 09:26:29 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-02-15 21:19:33 (GMT)
commit25bb90b10300fd7ede42e250e9b7c5b9f8a4fc15 (patch)
tree1117b3ed97d500c0b7b7d122add721015194b475 /t/t5570-git-daemon.sh
parentf3ee9ca53bc04e9770747ea58951135d60b11a8d (diff)
downloadgit-25bb90b10300fd7ede42e250e9b7c5b9f8a4fc15.zip
git-25bb90b10300fd7ede42e250e9b7c5b9f8a4fc15.tar.gz
git-25bb90b10300fd7ede42e250e9b7c5b9f8a4fc15.tar.bz2
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>
Diffstat (limited to 't/t5570-git-daemon.sh')
-rwxr-xr-xt/t5570-git-daemon.sh22
1 files changed, 20 insertions, 2 deletions
diff --git a/t/t5570-git-daemon.sh b/t/t5570-git-daemon.sh
index b7e2832..8621fee 100755
--- a/t/t5570-git-daemon.sh
+++ b/t/t5570-git-daemon.sh
@@ -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 &&
@@ -24,7 +30,8 @@ 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
'
@@ -32,10 +39,21 @@ 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 &&