]> Kevux Git Server - rit/commitdiff
make git a bit less cryptic on fetch errors
authorNicolas Pitre <nico@cam.org>
Mon, 18 Dec 2006 20:16:58 +0000 (15:16 -0500)
committerJunio C Hamano <junkio@cox.net>
Mon, 18 Dec 2006 23:31:28 +0000 (15:31 -0800)
The remote server might not want to tell why it doesn't like us for
security reasons, but let's make the client report such error in a bit
less confusing way.  The remote failure remains a mystery, but the local
message might be a bit less so.

[jc: with a gentle wording updates from Andy Parkins]

Signed-off-by: Nicolas Pitre <nico@cam.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
git-fetch.sh
git-ls-remote.sh
pkt-line.c

index 38101a6..ffbd44f 100755 (executable)
@@ -96,7 +96,7 @@ fi
 
 # Global that is reused later
 ls_remote_result=$(git ls-remote $upload_pack "$remote") ||
-       die "Cannot find the reflist at $remote"
+       die "Cannot get the repository state from $remote"
 
 append_fetch_head () {
     head_="$1"
index 0f88953..03b624e 100755 (executable)
@@ -94,7 +94,7 @@ while read sha1 path
 do
        case "$sha1" in
        failed)
-               die "Failed to find remote refs"
+               exit 1 ;;
        esac
        case "$path" in
        refs/heads/*)
index c1e81f9..b4cb7e2 100644 (file)
@@ -72,7 +72,7 @@ static void safe_read(int fd, void *buffer, unsigned size)
                if (ret < 0)
                        die("read error (%s)", strerror(errno));
                if (!ret)
-                       die("unexpected EOF");
+                       die("The remote end hung up unexpectedly");
                n += ret;
        }
 }