Disambiguate "push not supported" from "repository not found"
If we are pushing to a remote repository the reason why we
get no refs may be because push is not permitted, or it is
a bad URI and points to a non-existant repository.
To get a good error message for the user we need to open a
fetch connection to see if fetch also fails. If it failed
we know the URI is invalid; if fetch succeeds we know that
the repository is there but the user is just not allowed to
push to it over this transport.
With this change we now get useful error messages:
$ ./jgit.sh push git://repo.or.cz/egit.git refs/heads/master
fatal: git://repo.or.cz/egit.git: push not permitted
$ ./jgit.sh push git://repo.or.cz/fake.git refs/heads/master
fatal: git://repo.or.cz/fake.git: not found.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Robin Rosenberg <robin.rosenberg@dewire.com>
hhghgh