Merge branch 'maint'
* maint: Fix documentation grammar typo Allow curl helper to work without a local repository Require a struct remote in transport_get()
This commit is contained in:
commit
1b52ac5935
@ -120,7 +120,7 @@ closest tagname without any suffix:
|
||||
tags/v1.0.0
|
||||
|
||||
Note that the suffix you get if you type these commands today may be
|
||||
longer than what Linus saw above when he ran this command, as your
|
||||
longer than what Linus saw above when he ran these commands, as your
|
||||
git repository may have new commits whose object names begin with
|
||||
975b that did not exist back then, and "-g975b" suffix alone may not
|
||||
be sufficient to disambiguate these commits.
|
||||
|
@ -86,10 +86,10 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix)
|
||||
pattern[j - i] = p;
|
||||
}
|
||||
}
|
||||
remote = nongit ? NULL : remote_get(dest);
|
||||
if (remote && !remote->url_nr)
|
||||
remote = remote_get(dest);
|
||||
if (!remote->url_nr)
|
||||
die("remote %s has no configured URL", dest);
|
||||
transport = transport_get(remote, remote ? remote->url[0] : dest);
|
||||
transport = transport_get(remote, remote->url[0]);
|
||||
if (uploadpack != NULL)
|
||||
transport_set_option(transport, TRANS_OPT_UPLOADPACK, uploadpack);
|
||||
|
||||
|
@ -82,9 +82,10 @@ int main(int argc, const char **argv)
|
||||
struct strbuf buf = STRBUF_INIT;
|
||||
const char *url;
|
||||
struct walker *walker = NULL;
|
||||
int nongit;
|
||||
|
||||
git_extract_argv0_path(argv[0]);
|
||||
setup_git_directory();
|
||||
setup_git_directory_gently(&nongit);
|
||||
if (argc < 2) {
|
||||
fprintf(stderr, "Remote needed\n");
|
||||
return 1;
|
||||
@ -103,6 +104,8 @@ int main(int argc, const char **argv)
|
||||
break;
|
||||
if (!prefixcmp(buf.buf, "fetch ")) {
|
||||
char *obj = buf.buf + strlen("fetch ");
|
||||
if (nongit)
|
||||
die("Fetch attempted without a local repo");
|
||||
if (!walker)
|
||||
walker = get_http_walker(url, remote);
|
||||
walker->get_all = 1;
|
||||
|
@ -812,6 +812,9 @@ struct transport *transport_get(struct remote *remote, const char *url)
|
||||
{
|
||||
struct transport *ret = xcalloc(1, sizeof(*ret));
|
||||
|
||||
if (!remote)
|
||||
die("No remote provided to transport_get()");
|
||||
|
||||
ret->remote = remote;
|
||||
ret->url = url;
|
||||
|
||||
@ -849,10 +852,10 @@ struct transport *transport_get(struct remote *remote, const char *url)
|
||||
data->thin = 1;
|
||||
data->conn = NULL;
|
||||
data->uploadpack = "git-upload-pack";
|
||||
if (remote && remote->uploadpack)
|
||||
if (remote->uploadpack)
|
||||
data->uploadpack = remote->uploadpack;
|
||||
data->receivepack = "git-receive-pack";
|
||||
if (remote && remote->receivepack)
|
||||
if (remote->receivepack)
|
||||
data->receivepack = remote->receivepack;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user