vendor/libgit2/src/fetch.c in rugged-1.1.1 vs vendor/libgit2/src/fetch.c in rugged-1.2.0

- old
+ new

@@ -19,12 +19,15 @@ #include "repository.h" #include "refs.h" static int maybe_want(git_remote *remote, git_remote_head *head, git_odb *odb, git_refspec *tagspec, git_remote_autotag_option_t tagopt) { - int match = 0; + int match = 0, valid; - if (!git_reference_is_valid_name(head->name)) + if (git_reference_name_is_valid(&valid, head->name) < 0) + return -1; + + if (!valid) return 0; if (tagopt == GIT_REMOTE_DOWNLOAD_TAGS_ALL) { /* * If tagopt is --tags, always request tags