Have a constant extern refspec for "--tags"
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>
This commit is contained in:
parent
bef70b22ba
commit
e0aaa29ff3
@ -127,14 +127,8 @@ static struct ref *get_ref_map(struct transport *transport,
|
|||||||
/* Merge everything on the command line, but not --tags */
|
/* Merge everything on the command line, but not --tags */
|
||||||
for (rm = ref_map; rm; rm = rm->next)
|
for (rm = ref_map; rm; rm = rm->next)
|
||||||
rm->merge = 1;
|
rm->merge = 1;
|
||||||
if (tags == TAGS_SET) {
|
if (tags == TAGS_SET)
|
||||||
struct refspec refspec;
|
get_fetch_map(remote_refs, tag_refspec, &tail, 0);
|
||||||
refspec.src = "refs/tags/";
|
|
||||||
refspec.dst = "refs/tags/";
|
|
||||||
refspec.pattern = 1;
|
|
||||||
refspec.force = 0;
|
|
||||||
get_fetch_map(remote_refs, &refspec, &tail, 0);
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
/* Use the defaults */
|
/* Use the defaults */
|
||||||
struct remote *remote = transport->remote;
|
struct remote *remote = transport->remote;
|
||||||
|
9
remote.c
9
remote.c
@ -2,6 +2,15 @@
|
|||||||
#include "remote.h"
|
#include "remote.h"
|
||||||
#include "refs.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 {
|
struct counted_string {
|
||||||
size_t len;
|
size_t len;
|
||||||
const char *s;
|
const char *s;
|
||||||
|
2
remote.h
2
remote.h
@ -51,6 +51,8 @@ struct refspec {
|
|||||||
char *dst;
|
char *dst;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
extern const struct refspec *tag_refspec;
|
||||||
|
|
||||||
struct ref *alloc_ref(unsigned namelen);
|
struct ref *alloc_ref(unsigned namelen);
|
||||||
|
|
||||||
struct ref *copy_ref_list(const struct ref *ref);
|
struct ref *copy_ref_list(const struct ref *ref);
|
||||||
|
Loading…
Reference in New Issue
Block a user