vendor/libgit2/src/fetch.c in rugged-0.18.0.gh.de28323 vs vendor/libgit2/src/fetch.c in rugged-0.19.0

- old
+ new

@@ -14,10 +14,12 @@ #include "remote.h" #include "refspec.h" #include "pack.h" #include "fetch.h" #include "netops.h" +#include "repository.h" +#include "refs.h" struct filter_payload { git_remote *remote; const git_refspec *spec, *tagspec; git_odb *odb; @@ -32,14 +34,20 @@ if (!git_reference_is_valid_name(head->name)) return 0; if (!p->found_head && strcmp(head->name, GIT_HEAD_FILE) == 0) p->found_head = 1; - else if (git_refspec_src_matches(p->spec, head->name)) + else if (p->remote->download_tags == GIT_REMOTE_DOWNLOAD_TAGS_ALL) { + /* + * If tagopt is --tags, then we only use the default + * tags refspec and ignore the remote's + */ + if (git_refspec_src_matches(p->tagspec, head->name)) match = 1; - else if (p->remote->download_tags == GIT_REMOTE_DOWNLOAD_TAGS_ALL && - git_refspec_src_matches(p->tagspec, head->name)) + else + return 0; + } else if (git_remote__matching_refspec(p->remote, head->name)) match = 1; if (!match) return 0; @@ -66,10 +74,9 @@ * The fetch refspec can be NULL, and what this means is that the * user didn't specify one. This is fine, as it means that we're * not interested in any particular branch but just the remote's * HEAD, which will be stored in FETCH_HEAD after the fetch. */ - p.spec = git_remote_fetchspec(remote); p.tagspec = &tagspec; p.found_head = 0; p.remote = remote; if (git_repository_odb__weakptr(&p.odb, remote->repo) < 0)