summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d8a1dee)
raw | patch | inline | side by side (parent: d8a1dee)
author | Junio C Hamano <junkio@cox.net> | |
Fri, 14 Oct 2005 01:57:40 +0000 (18:57 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Sat, 15 Oct 2005 18:23:40 +0000 (11:23 -0700) |
This allows the remote side (most notably, upload-pack) to show
additional information without affecting the downloader. Peek-remote
does not ignore them -- this is to make it useful for Pasky's
automatic tag following.
Signed-off-by: Junio C Hamano <junkio@cox.net>
additional information without affecting the downloader. Peek-remote
does not ignore them -- this is to make it useful for Pasky's
automatic tag following.
Signed-off-by: Junio C Hamano <junkio@cox.net>
cache.h | patch | blob | history | |
clone-pack.c | patch | blob | history | |
connect.c | patch | blob | history | |
fetch-pack.c | patch | blob | history | |
peek-remote.c | patch | blob | history | |
send-pack.c | patch | blob | history |
index f1d15ab3c9f1006f99c9852b2ce1d1209d986064..d776016822a8fed78358c7dccc334ee576302a36 100644 (file)
--- a/cache.h
+++ b/cache.h
extern int match_refs(struct ref *src, struct ref *dst, struct ref ***dst_tail,
int nr_refspec, char **refspec, int all);
extern int get_ack(int fd, unsigned char *result_sha1);
-extern struct ref **get_remote_heads(int in, struct ref **list, int nr_match, char **match);
+extern struct ref **get_remote_heads(int in, struct ref **list, int nr_match, char **match, int ignore_funny);
extern struct packed_git *parse_pack_index(unsigned char *sha1);
extern struct packed_git *parse_pack_index_file(const unsigned char *sha1,
diff --git a/clone-pack.c b/clone-pack.c
index 0ea7e7f65deaa41847bf5c8a1a5e812a09d4acf2..f9b263a441eb2559a904e3db9fb35fac05b9590e 100644 (file)
--- a/clone-pack.c
+++ b/clone-pack.c
struct ref *refs;
int status;
- get_remote_heads(fd[0], &refs, nr_match, match);
+ get_remote_heads(fd[0], &refs, nr_match, match, 1);
if (!refs) {
packet_flush(fd[1]);
die("no matching remote head");
diff --git a/connect.c b/connect.c
index 247f02fb4cb3b3f96017c45427dfafd077692ebd..f71eba8af8b994fee8a928fc0a18ce08a9fd3506 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)
+struct ref **get_remote_heads(int in, struct ref **list,
+ int nr_match, char **match, int ignore_funny)
{
*list = NULL;
for (;;) {
if (len < 42 || get_sha1_hex(buffer, old_sha1) || buffer[40] != ' ')
die("protocol error: expected sha/ref, got '%s'", buffer);
name = buffer + 41;
+
+ if (ignore_funny && 45 < len && !memcmp(name, "refs/", 5) &&
+ check_ref_format(name + 5))
+ continue;
+
if (nr_match && !path_match(name, nr_match, match))
continue;
ref = xcalloc(1, sizeof(*ref) + len - 40);
diff --git a/fetch-pack.c b/fetch-pack.c
index 582f967a7af68670a6bb174745e43df35a2d0eef..953c0cf441c282bcfb50ce36299c4da3c90e290f 100644 (file)
--- a/fetch-pack.c
+++ b/fetch-pack.c
int status;
pid_t pid;
- get_remote_heads(fd[0], &ref, nr_match, match);
+ get_remote_heads(fd[0], &ref, nr_match, match, 1);
if (!ref) {
packet_flush(fd[1]);
die("no matching remote head");
diff --git a/peek-remote.c b/peek-remote.c
index 4b1d0d5ba8ebb61c50a8766c73c6ba19e6efdef9..ee49bf3b7b123359153a961c56f5aa3d58515864 100644 (file)
--- a/peek-remote.c
+++ b/peek-remote.c
{
struct ref *ref;
- get_remote_heads(fd[0], &ref, 0, NULL);
+ get_remote_heads(fd[0], &ref, 0, NULL, 0);
packet_flush(fd[1]);
while (ref) {
diff --git a/send-pack.c b/send-pack.c
index 55d8ff7e102fa6cc369c993035c0579c2d33b775..9f9a6e70b8789f63891c5b6e07822c546af8eec4 100644 (file)
--- a/send-pack.c
+++ b/send-pack.c
int new_refs;
/* No funny business with the matcher */
- remote_tail = get_remote_heads(in, &remote_refs, 0, NULL);
+ remote_tail = get_remote_heads(in, &remote_refs, 0, NULL, 1);
get_local_heads();
/* match them up */