summaryrefslogtreecommitdiff
path: root/src/transports/git.c
diff options
context:
space:
mode:
authorBen Straub <bs@github.com>2013-01-30 19:03:58 -0800
committerBen Straub <bs@github.com>2013-01-30 19:03:58 -0800
commit2234b2b03153c03fc6d502dd61ae55e659be4b8b (patch)
treef3ebc65392fa5c94c3c11c809688454f51f64c48 /src/transports/git.c
parent5f10853e90014ea9929a976f647f2a2d32a2c129 (diff)
downloadlibgit2-2234b2b03153c03fc6d502dd61ae55e659be4b8b.tar.gz
Stash username from url (but don't use it yet)
Diffstat (limited to 'src/transports/git.c')
-rw-r--r--src/transports/git.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/transports/git.c b/src/transports/git.c
index ba6dbfea9..5c816e127 100644
--- a/src/transports/git.c
+++ b/src/transports/git.c
@@ -179,7 +179,7 @@ static int _git_uploadpack_ls(
const char *url,
git_smart_subtransport_stream **stream)
{
- char *host, *port;
+ char *host, *port, *user;
git_stream *s;
*stream = NULL;
@@ -192,7 +192,7 @@ static int _git_uploadpack_ls(
s = (git_stream *)*stream;
- if (gitno_extract_host_and_port(&host, &port, url, GIT_DEFAULT_PORT) < 0)
+ if (gitno_extract_host_and_port(&host, &port, &user, url, GIT_DEFAULT_PORT) < 0)
goto on_error;
if (gitno_connect(&s->socket, host, port, 0) < 0)
@@ -201,6 +201,7 @@ static int _git_uploadpack_ls(
t->current_stream = s;
git__free(host);
git__free(port);
+ git__free(user);
return 0;
on_error:
@@ -233,7 +234,7 @@ static int _git_receivepack_ls(
const char *url,
git_smart_subtransport_stream **stream)
{
- char *host, *port;
+ char *host, *port, *user;
git_stream *s;
*stream = NULL;
@@ -246,7 +247,7 @@ static int _git_receivepack_ls(
s = (git_stream *)*stream;
- if (gitno_extract_host_and_port(&host, &port, url, GIT_DEFAULT_PORT) < 0)
+ if (gitno_extract_host_and_port(&host, &port, &user, url, GIT_DEFAULT_PORT) < 0)
goto on_error;
if (gitno_connect(&s->socket, host, port, 0) < 0)
@@ -255,6 +256,7 @@ static int _git_receivepack_ls(
t->current_stream = s;
git__free(host);
git__free(port);
+ git__free(user);
return 0;
on_error: