vendor/libgit2/src/transports/git.c in rugged-1.3.2.3 vs vendor/libgit2/src/transports/git.c in rugged-1.4.2
- old
+ new
@@ -5,16 +5,14 @@
* a Linking Exception. For full terms see the included COPYING file.
*/
#include "common.h"
-#include "git2.h"
-#include "buffer.h"
#include "netops.h"
-#include "git2/sys/transport.h"
#include "stream.h"
#include "streams/socket.h"
+#include "git2/sys/transport.h"
#define OWNING_SUBTRANSPORT(s) ((git_subtransport *)(s)->parent.subtransport)
static const char prefix_git[] = "git://";
static const char cmd_uploadpack[] = "git-upload-pack";
@@ -37,11 +35,11 @@
/*
* Create a git protocol request.
*
* For example: 0035git-upload-pack /libgit2/libgit2\0host=github.com\0
*/
-static int gen_proto(git_buf *request, const char *cmd, const char *url)
+static int gen_proto(git_str *request, const char *cmd, const char *url)
{
char *delim, *repo;
char host[] = "host=";
size_t len;
@@ -59,25 +57,25 @@
if (delim == NULL)
delim = strchr(url, '/');
len = 4 + strlen(cmd) + 1 + strlen(repo) + 1 + strlen(host) + (delim - url) + 1;
- git_buf_grow(request, len);
- git_buf_printf(request, "%04x%s %s%c%s",
+ git_str_grow(request, len);
+ git_str_printf(request, "%04x%s %s%c%s",
(unsigned int)(len & 0x0FFFF), cmd, repo, 0, host);
- git_buf_put(request, url, delim - url);
- git_buf_putc(request, '\0');
+ git_str_put(request, url, delim - url);
+ git_str_putc(request, '\0');
- if (git_buf_oom(request))
+ if (git_str_oom(request))
return -1;
return 0;
}
static int send_command(git_proto_stream *s)
{
- git_buf request = GIT_BUF_INIT;
+ git_str request = GIT_STR_INIT;
int error;
if ((error = gen_proto(&request, s->cmd, s->url)) < 0)
goto cleanup;
@@ -85,10 +83,10 @@
goto cleanup;
s->sent_command = 1;
cleanup:
- git_buf_dispose(&request);
+ git_str_dispose(&request);
return error;
}
static int git_proto_stream_read(
git_smart_subtransport_stream *stream,