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
*/
*
* 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;
prog, path, 0,
target_host, 0);
free(target_host);
+ free(url);
if (free_path)
free(path);
return NULL;
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;