summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5aaf7f2)
raw | patch | inline | side by side (parent: 5aaf7f2)
author | Shawn O. Pearce <spearce@spearce.org> | |
Mon, 3 Mar 2008 02:35:00 +0000 (21:35 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 3 Mar 2008 08:05:45 +0000 (00:05 -0800) |
By allowing the function to append onto the end of an existing list
we can do more interesting things, like join the list of tags we
want to fetch into the first fetch, rather than the second.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
we can do more interesting things, like join the list of tags we
want to fetch into the first fetch, rather than the second.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-fetch.c | patch | blob | history |
diff --git a/builtin-fetch.c b/builtin-fetch.c
index 5bce20f94f300e6ce1c96bf5971a4cfd4408f0ff..1d3ce775ab48e5f73eaa5cb7977ce3e4c1af1881 100644 (file)
--- a/builtin-fetch.c
+++ b/builtin-fetch.c
return 0;
}
-static struct ref *find_non_local_tags(struct transport *transport)
+static void find_non_local_tags(struct transport *transport,
+ struct ref **head,
+ struct ref ***tail)
{
static struct path_list existing_refs = { NULL, 0, 0, 0 };
struct path_list new_refs = { NULL, 0, 0, 1 };
const unsigned char *ref_sha1;
const struct ref *tag_ref;
struct ref *rm = NULL;
- struct ref *ref_map = NULL;
- struct ref **tail = &ref_map;
const struct ref *ref;
for_each_ref(add_existing, &existing_refs);
strcpy(rm->peer_ref->name, ref_name);
hashcpy(rm->old_sha1, ref_sha1);
- *tail = rm;
- tail = &rm->next;
+ **tail = rm;
+ *tail = &rm->next;
}
free(ref_name);
}
-
- return ref_map;
}
static int do_fetch(struct transport *transport,
/* if neither --no-tags nor --tags was specified, do automated tag
* following ... */
if (tags == TAGS_DEFAULT && autotags) {
- ref_map = find_non_local_tags(transport);
+ struct ref **tail = &ref_map;
+ ref_map = NULL;
+ find_non_local_tags(transport, &ref_map, &tail);
if (ref_map) {
transport_set_option(transport, TRANS_OPT_DEPTH, "0");
fetch_refs(transport, ref_map);