Merge branch 'hv/remote-end-hung-up'
authorJunio C Hamano <gitster@pobox.com>
Thu, 5 Jul 2012 06:40:11 +0000 (23:40 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 5 Jul 2012 06:40:12 +0000 (23:40 -0700)
When we get disconnected while expecting a response from the remote
side because authentication failed, we issued an error message "The
remote side hung up unexpectedly."

Give hint that it may be a permission problem in the message when we
can reasonably suspect it.

* hv/remote-end-hung-up:
remove the impression of unexpectedness when access is denied

1  2 
connect.c
t/t5512-ls-remote.sh
diff --cc connect.c
Simple merge
index 6764d511ce08cf62da2c257bf5fe50cabaf2f03c,2ab66d6e3383097079406d1aeab91737567d2875..d16e5d384a8966bc04e9fde6e92bd41818526aab
@@@ -82,22 -99,21 +82,20 @@@ test_expect_success 'use branch.<name>.
        git ls-remote 2>actual_err >actual &&
        test_cmp exp_err actual_err &&
        test_cmp exp actual
 -
  '
  
 -cat >exp <<EOF
 -fatal: 'refs*master' does not appear to be a git repository
 -fatal: Could not read from remote repository.
 -
 -Please make sure you have the correct access rights
 -and the repository exists.
 -EOF
  test_expect_success 'confuses pattern as remote when no remote specified' '
-       fatal: The remote end hung up unexpectedly
 +      cat >exp <<-\EOF &&
 +      fatal: '\''refs*master'\'' does not appear to be a git repository
++      fatal: Could not read from remote repository.
++
++      Please make sure you have the correct access rights
++      and the repository exists.
 +      EOF
        #
-       # Do not expect "git ls-remote <pattern>" to work; ls-remote, correctly,
-       # confuses <pattern> for <remote>. Although ugly, this behaviour is akin
-       # to the confusion of refspecs for remotes by git-fetch and git-push,
-       # eg:
-       #
-       #   $ git fetch branch
-       #
+       # Do not expect "git ls-remote <pattern>" to work; ls-remote needs
+       # <remote> if you want to feed <pattern>, just like you cannot say
+       # fetch <branch>.
        # We could just as easily have used "master"; the "*" emphasizes its
        # role as a pattern.
        test_must_fail git ls-remote refs*master >actual 2>&1 &&