summaryrefslogtreecommitdiff
path: root/connect.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2007-11-24 16:45:37 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2007-11-24 16:45:37 -0800
commitfd200790dc518f297bfd538a53e232802904f1de (patch)
tree09347c007dd813b86fe3ff58d897997b7e8aac49 /connect.c
parentMerge branch 'sb/clean' (diff)
parentsend-pack: cluster ref status reporting (diff)
downloadtgif-fd200790dc518f297bfd538a53e232802904f1de.tar.xz
Merge branch 'jk/send-pack'
* jk/send-pack: (24 commits) send-pack: cluster ref status reporting send-pack: fix "everything up-to-date" message send-pack: tighten remote error reporting make "find_ref_by_name" a public function Fix warning about bitfield in struct ref send-pack: assign remote errors to each ref send-pack: check ref->status before updating tracking refs send-pack: track errors for each ref git-push: add documentation for the newly added --mirror mode Add tests for git push'es mirror mode Update the tracking references only if they were succesfully updated on remote Add a test checking if send-pack updated local tracking branches correctly git-push: plumb in --mirror mode Teach send-pack a mirror mode send-pack: segfault fix on forced push Reteach builtin-ls-remote to understand remotes send-pack: require --verbose to show update of tracking refs receive-pack: don't mention successful updates more terse push output Build in ls-remote ...
Diffstat (limited to 'connect.c')
-rw-r--r--connect.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/connect.c b/connect.c
index 44e423dafd..3aefd4ace5 100644
--- a/connect.c
+++ b/connect.c
@@ -36,6 +36,11 @@ static int check_ref(const char *name, int len, unsigned int flags)
return !(flags & ~REF_NORMAL);
}
+int check_ref_type(const struct ref *ref, int flags)
+{
+ return check_ref(ref->name, strlen(ref->name), flags);
+}
+
/*
* Read all the refs from the other end
*/
@@ -476,9 +481,10 @@ char *get_port(char *host)
*
* If it returns, the connect is successful; it just dies on errors.
*/
-struct child_process *git_connect(int fd[2], char *url,
+struct child_process *git_connect(int fd[2], const char *url_orig,
const char *prog, int flags)
{
+ char *url = xstrdup(url_orig);
char *host, *path = url;
char *end;
int c;
@@ -568,6 +574,7 @@ struct child_process *git_connect(int fd[2], char *url,
prog, path, 0,
target_host, 0);
free(target_host);
+ free(url);
if (free_path)
free(path);
return NULL;
@@ -619,6 +626,7 @@ struct child_process *git_connect(int fd[2], char *url,
fd[0] = conn->out; /* read from child's stdout */
fd[1] = conn->in; /* write to child's stdin */
strbuf_release(&cmd);
+ free(url);
if (free_path)
free(path);
return conn;