summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 10dd3b2)
raw | patch | inline | side by side (parent: 10dd3b2)
author | Jeff King <peff@peff.net> | |
Tue, 13 Dec 2011 00:41:37 +0000 (19:41 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Tue, 13 Dec 2011 18:08:24 +0000 (10:08 -0800) |
The get_remote_heads function reads the list of remote refs
during git protocol session. It dates all the way back to
def88e9 (Commit first cut at "git-fetch-pack", 2005-07-04).
At that time, the idea was to come up with a list of refs we
were interested in, and then filter the list as we got it
from the remote side.
Later, 1baaae5 (Make maximal use of the remote refs,
2005-10-28) stopped filtering at the get_remote_heads layer,
letting us use the non-matching refs to find common history.
As a result, all callers now simply pass an empty match
list (and any future callers will want to do the same). So
let's drop these now-useless parameters.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
during git protocol session. It dates all the way back to
def88e9 (Commit first cut at "git-fetch-pack", 2005-07-04).
At that time, the idea was to come up with a list of refs we
were interested in, and then filter the list as we got it
from the remote side.
Later, 1baaae5 (Make maximal use of the remote refs,
2005-10-28) stopped filtering at the get_remote_heads layer,
letting us use the non-matching refs to find common history.
As a result, all callers now simply pass an empty match
list (and any future callers will want to do the same). So
let's drop these now-useless parameters.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/fetch-pack.c | patch | blob | history | |
builtin/send-pack.c | patch | blob | history | |
cache.h | patch | blob | history | |
connect.c | patch | blob | history | |
remote-curl.c | patch | blob | history | |
transport.c | patch | blob | history |
diff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c
index c6bc8eb0aa6f5a6bc35c69e7893118a17813db7d..46688dc14b617496971f40284d097782184509e2 100644 (file)
--- a/builtin/fetch-pack.c
+++ b/builtin/fetch-pack.c
args.verbose ? CONNECT_VERBOSE : 0);
}
- get_remote_heads(fd[0], &ref, 0, NULL, 0, NULL);
+ get_remote_heads(fd[0], &ref, 0, NULL);
ref = fetch_pack(&args, fd, conn, ref, dest,
nr_heads, heads, pack_lockfile_ptr);
diff --git a/builtin/send-pack.c b/builtin/send-pack.c
index e0b8030f2b31ee337bc2d2e0925788ec6cd92e0f..cd1115ffc687c642acd4bda09b1ea7976e1e0478 100644 (file)
--- a/builtin/send-pack.c
+++ b/builtin/send-pack.c
memset(&extra_have, 0, sizeof(extra_have));
- get_remote_heads(fd[0], &remote_refs, 0, NULL, REF_NORMAL,
- &extra_have);
+ get_remote_heads(fd[0], &remote_refs, REF_NORMAL, &extra_have);
transport_verify_remote_names(nr_refspecs, refspecs);
index 2e6ad3604e4cc6efd60a69407159967a1940e680..451960175cf33626d3c50dccdf05e1bb7aa65d07 100644 (file)
--- a/cache.h
+++ b/cache.h
int nr, alloc;
unsigned char (*array)[20];
};
-extern struct ref **get_remote_heads(int in, struct ref **list, int nr_match, char **match, unsigned int flags, struct extra_have_objects *);
+extern struct ref **get_remote_heads(int in, struct ref **list, unsigned int flags, struct extra_have_objects *);
extern int server_supports(const char *feature);
extern struct packed_git *parse_pack_index(unsigned char *sha1, const char *idx_path);
diff --git a/connect.c b/connect.c
index 51990fa0cb300a95b125b0727f10133961d0167b..48df90bfe56068109476ec62fb8209db20c4e8cf 100644 (file)
--- a/connect.c
+++ b/connect.c
* Read all the refs from the other end
*/
struct ref **get_remote_heads(int in, struct ref **list,
- int nr_match, char **match,
unsigned int flags,
struct extra_have_objects *extra_have)
{
if (!check_ref(name, name_len, flags))
continue;
- if (nr_match && !path_match(name, nr_match, match))
- continue;
ref = alloc_ref(buffer + 41);
hashcpy(ref->old_sha1, old_sha1);
*list = ref;
diff --git a/remote-curl.c b/remote-curl.c
index 0e720ee8bbf4cbc6a50336a1f1c93bfc63842fe3..94dc4886d0047b6ce550c5a5d17b61c42fbb18c6 100644 (file)
--- a/remote-curl.c
+++ b/remote-curl.c
if (start_async(&async))
die("cannot start thread to parse advertised refs");
- get_remote_heads(async.out, &list, 0, NULL, 0, NULL);
+ get_remote_heads(async.out, &list, 0, NULL);
close(async.out);
if (finish_async(&async))
die("ref parsing thread failed");
diff --git a/transport.c b/transport.c
index 51814b5da3064b617fa268a6b2bc6b3d6cb0b110..c2245d4f0d59d35cf0ae77fad25d80697a3901e6 100644 (file)
--- a/transport.c
+++ b/transport.c
@@ -502,7 +502,7 @@ static struct ref *get_refs_via_connect(struct transport *transport, int for_pus
struct ref *refs;
connect_setup(transport, for_push, 0);
- get_remote_heads(data->fd[0], &refs, 0, NULL,
+ get_remote_heads(data->fd[0], &refs,
for_push ? REF_NORMAL : 0, &data->extra_have);
data->got_remote_heads = 1;
if (!data->got_remote_heads) {
connect_setup(transport, 0, 0);
- get_remote_heads(data->fd[0], &refs_tmp, 0, NULL, 0, NULL);
+ get_remote_heads(data->fd[0], &refs_tmp, 0, NULL);
data->got_remote_heads = 1;
}
@@ -772,8 +772,7 @@ static int git_transport_push(struct transport *transport, struct ref *remote_re
struct ref *tmp_refs;
connect_setup(transport, 1, 0);
- get_remote_heads(data->fd[0], &tmp_refs, 0, NULL, REF_NORMAL,
- NULL);
+ get_remote_heads(data->fd[0], &tmp_refs, REF_NORMAL, NULL);
data->got_remote_heads = 1;
}