summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5c1e235)
raw | patch | inline | side by side (parent: 5c1e235)
author | Alexandre Julliard <julliard@winehq.org> | |
Thu, 2 Nov 2006 11:13:32 +0000 (12:13 +0100) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Fri, 3 Nov 2006 02:04:40 +0000 (18:04 -0800) |
Using for_each_tag_ref() to enumerate tags is wrong since it removes
the refs/tags/ prefix, we need to always use for_each_ref() and filter
out non-tag references in the callback.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
the refs/tags/ prefix, we need to always use for_each_ref() and filter
out non-tag references in the callback.
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
builtin-pack-refs.c | patch | blob | history |
diff --git a/builtin-pack-refs.c b/builtin-pack-refs.c
index 1087657674840820662cba686f525a69a68e689c..042d2718f904303600a57cfe8b5de83f5c0d34db 100644 (file)
--- a/builtin-pack-refs.c
+++ b/builtin-pack-refs.c
struct pack_refs_cb_data {
int prune;
+ int all;
struct ref_to_prune *ref_to_prune;
FILE *refs_file;
};
{
struct pack_refs_cb_data *cb = cb_data;
+ if (!cb->all && strncmp(path, "refs/tags/", 10))
+ return 0;
/* Do not pack the symbolic refs */
if (!(flags & REF_ISSYMREF))
fprintf(cb->refs_file, "%s %s\n", sha1_to_hex(sha1), path);
{
int fd, i;
struct pack_refs_cb_data cbdata;
- int (*iterate_ref)(each_ref_fn, void *) = for_each_tag_ref;
memset(&cbdata, 0, sizeof(cbdata));
continue;
}
if (!strcmp(arg, "--all")) {
- iterate_ref = for_each_ref;
+ cbdata.all = 1;
continue;
}
/* perhaps other parameters later... */
if (!cbdata.refs_file)
die("unable to create ref-pack file structure (%s)",
strerror(errno));
- iterate_ref(handle_one_ref, &cbdata);
+ for_each_ref(handle_one_ref, &cbdata);
fflush(cbdata.refs_file);
fsync(fd);
fclose(cbdata.refs_file);