Commit 4e974c97 by Graham Dennis

Fix local push to file:// URL.

parent b6815fe0
......@@ -344,11 +344,29 @@ static int local_push(
git_repository *remote_repo = NULL;
push_spec *spec;
char *url = NULL;
const char *path;
git_buf buf = GIT_BUF_INIT;
int error;
unsigned int i;
size_t j;
if ((error = git_repository_open(&remote_repo, push->remote->url)) < 0)
/* The repo layer doesn't want the prefix */
if (!git__prefixcmp(push->remote->url, "file://")) {
if (git_path_fromurl(&buf, push->remote->url) < 0) {
git_buf_free(&buf);
return -1;
}
path = git_buf_cstr(&buf);
} else { /* We assume push->remote->url is already a path */
path = push->remote->url;
}
error = git_repository_open(&remote_repo, path);
git_buf_free(&buf);
if (error < 0)
return error;
/* We don't currently support pushing locally to non-bare repos. Proper
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment