diff options
author | Vicent Martà <tanoku@gmail.com> | 2012-04-30 14:38:15 -0700 |
---|---|---|
committer | Vicent Martà <tanoku@gmail.com> | 2012-04-30 14:38:15 -0700 |
commit | ced9da5412f38eea6d032586d45eba6ebfd34554 (patch) | |
tree | b7f144f2f0e441909f1deae92136f6ee2d7d85ce /src/protocol.c | |
parent | 0dc8e95e1940017a9d6e8f5b13cf9a9ad644fc08 (diff) | |
parent | 39e6af6a7c526823b06f2c7bfe97c0c7bf9501d5 (diff) | |
download | libgit2-ced9da5412f38eea6d032586d45eba6ebfd34554.tar.gz |
Merge pull request #654 from carlosmn/pkt-err
Recognize and report server-side error messages
Diffstat (limited to 'src/protocol.c')
-rw-r--r-- | src/protocol.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/protocol.c b/src/protocol.c index a7df961a9..a75354121 100644 --- a/src/protocol.c +++ b/src/protocol.c @@ -40,6 +40,13 @@ int git_protocol_store_refs(git_protocol *p, const char *data, size_t len) return p->error = -1; git_buf_consume(buf, line_end); + + if (pkt->type == GIT_PKT_ERR) { + giterr_set(GITERR_NET, "Remote error: %s", ((git_pkt_err *)pkt)->error); + git__free(pkt); + return -1; + } + if (git_vector_insert(refs, pkt) < 0) return p->error = -1; |