summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bef70b2)
raw | patch | inline | side by side (parent: bef70b2)
author | Daniel Barkalow <barkalow@iabervon.org> | |
Thu, 17 Apr 2008 23:32:35 +0000 (19:32 -0400) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 5 May 2008 00:41:44 +0000 (17:41 -0700) |
The refspec refs/tags/*:refs/tags/* is sufficiently common and generic
to merit having a constant instead of generating it as needed.
Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
to merit having a constant instead of generating it as needed.
Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-fetch.c | patch | blob | history | |
remote.c | patch | blob | history | |
remote.h | patch | blob | history |
diff --git a/builtin-fetch.c b/builtin-fetch.c
index 167f948036170fd2ec5a8e3bd3ca20359d8c9ee5..30aa42df6ebb1afb429442a51493ece9dccd2a0c 100644 (file)
--- a/builtin-fetch.c
+++ b/builtin-fetch.c
/* Merge everything on the command line, but not --tags */
for (rm = ref_map; rm; rm = rm->next)
rm->merge = 1;
- if (tags == TAGS_SET) {
- struct refspec refspec;
- refspec.src = "refs/tags/";
- refspec.dst = "refs/tags/";
- refspec.pattern = 1;
- refspec.force = 0;
- get_fetch_map(remote_refs, &refspec, &tail, 0);
- }
+ if (tags == TAGS_SET)
+ get_fetch_map(remote_refs, tag_refspec, &tail, 0);
} else {
/* Use the defaults */
struct remote *remote = transport->remote;
diff --git a/remote.c b/remote.c
index 2d9af4023eba6f8b2fe528ccbf03569fcaa265ee..9cb40afd0e3a4a35d9811ba48c5b08a0b39cf565 100644 (file)
--- a/remote.c
+++ b/remote.c
#include "remote.h"
#include "refs.h"
+static struct refspec s_tag_refspec = {
+ 0,
+ 1,
+ "refs/tags/",
+ "refs/tags/"
+};
+
+const struct refspec *tag_refspec = &s_tag_refspec;
+
struct counted_string {
size_t len;
const char *s;
diff --git a/remote.h b/remote.h
index a38774bbdc5acfb5ed9360ac92e1049fa79b26e1..f0a79de210ce34c62781ebb7e0aa8a66390226b7 100644 (file)
--- a/remote.h
+++ b/remote.h
char *dst;
};
+extern const struct refspec *tag_refspec;
+
struct ref *alloc_ref(unsigned namelen);
struct ref *copy_ref_list(const struct ref *ref);