Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2013-10-23 17:45:29 +0400
committerCarlos Martín Nieto <cmn@dwim.me>2013-10-23 17:45:29 +0400
commit5cb136705d7db2822357582d5b726c91ca044b24 (patch)
tree8e8e7a3a55169266e7eaf6f5034c68aebe1c3951 /src/transports
parent1c74686e05c41c30944173bacec3a8312f08cbb5 (diff)
transport: let the progress output return an error
There are any number of issues that can come up in the progress callback, and we should let the user cancel at that point as well.
Diffstat (limited to 'src/transports')
-rw-r--r--src/transports/smart_protocol.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/transports/smart_protocol.c b/src/transports/smart_protocol.c
index 24677908e..3b4d57856 100644
--- a/src/transports/smart_protocol.c
+++ b/src/transports/smart_protocol.c
@@ -509,7 +509,10 @@ int git_smart__download_pack(
if (pkt->type == GIT_PKT_PROGRESS) {
if (t->progress_cb) {
git_pkt_progress *p = (git_pkt_progress *) pkt;
- t->progress_cb(p->data, p->len, t->message_cb_payload);
+ if (t->progress_cb(p->data, p->len, t->message_cb_payload)) {
+ giterr_set(GITERR_NET, "The fetch was cancelled by the user");
+ return GIT_EUSER;
+ }
}
git__free(pkt);
} else if (pkt->type == GIT_PKT_DATA) {