summaryrefslogtreecommitdiff
path: root/src/fetch.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/fetch.c')
-rw-r--r--src/fetch.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/fetch.c b/src/fetch.c
index d96ac7781..eb13701f1 100644
--- a/src/fetch.c
+++ b/src/fetch.c
@@ -324,7 +324,10 @@ int git_fetch__download_pack(
goto on_error;
*bytes += recvd;
- } while(recvd > 0);
+ } while(recvd > 0 && !stats->data_received);
+
+ if (!stats->data_received)
+ giterr_set(GITERR_NET, "Early EOF while downloading packfile");
if (git_indexer_stream_finalize(idx, stats))
goto on_error;