summaryrefslogtreecommitdiff
path: root/transport.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2013-03-21 21:02:27 (GMT)
committerJunio C Hamano <gitster@pobox.com>2013-03-21 21:02:27 (GMT)
commite4e1c5499056de58f7df207cf41274a321857c77 (patch)
tree0db72148291ce77c21c959a5ed7fe333f1271409 /transport.c
parentc241e285e53bc84def85682eeaa265c1cd99cceb (diff)
parent6e7b66eebd18c11f58a9790b8f071618a1bb5b2c (diff)
downloadgit-e4e1c5499056de58f7df207cf41274a321857c77.zip
git-e4e1c5499056de58f7df207cf41274a321857c77.tar.gz
git-e4e1c5499056de58f7df207cf41274a321857c77.tar.bz2
Merge branch 'jc/fetch-raw-sha1'
Allows requests to fetch objects at any tip of refs (including hidden ones). It seems that there may be use cases even outside Gerrit (e.g. $gmane/215701). * jc/fetch-raw-sha1: fetch: fetch objects by their exact SHA-1 object names upload-pack: optionally allow fetching from the tips of hidden refs fetch: use struct ref to represent refs to be fetched parse_fetch_refspec(): clarify the codeflow a bit
Diffstat (limited to 'transport.c')
-rw-r--r--transport.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/transport.c b/transport.c
index 886ffd8..bd290fa 100644
--- a/transport.c
+++ b/transport.c
@@ -518,11 +518,9 @@ static int fetch_refs_via_pack(struct transport *transport,
int nr_heads, struct ref **to_fetch)
{
struct git_transport_data *data = transport->data;
- struct string_list sought = STRING_LIST_INIT_DUP;
const struct ref *refs;
char *dest = xstrdup(transport->url);
struct fetch_pack_args args;
- int i;
struct ref *refs_tmp = NULL;
memset(&args, 0, sizeof(args));
@@ -536,9 +534,6 @@ static int fetch_refs_via_pack(struct transport *transport,
args.no_progress = !transport->progress;
args.depth = data->options.depth;
- for (i = 0; i < nr_heads; i++)
- string_list_append(&sought, to_fetch[i]->name);
-
if (!data->got_remote_heads) {
connect_setup(transport, 0, 0);
get_remote_heads(data->fd[0], &refs_tmp, 0, NULL);
@@ -547,7 +542,8 @@ static int fetch_refs_via_pack(struct transport *transport,
refs = fetch_pack(&args, data->fd, data->conn,
refs_tmp ? refs_tmp : transport->remote_refs,
- dest, &sought, &transport->pack_lockfile);
+ dest, to_fetch, nr_heads,
+ &transport->pack_lockfile);
close(data->fd[0]);
close(data->fd[1]);
if (finish_connect(data->conn))
@@ -557,7 +553,6 @@ static int fetch_refs_via_pack(struct transport *transport,
free_refs(refs_tmp);
- string_list_clear(&sought, 0);
free(dest);
return (refs ? 0 : -1);
}