@@ -526,6 +526,31 @@ typedef enum {
526526 GIT_FETCH_NO_PRUNE ,
527527} git_fetch_prune_t ;
528528
529+ /**
530+ * Automatic tag following option
531+ *
532+ * Lets us select the --tags option to use.
533+ */
534+ typedef enum {
535+ /**
536+ * Use the setting from the configuration.
537+ */
538+ GIT_REMOTE_DOWNLOAD_TAGS_FALLBACK = 0 ,
539+ /**
540+ * Ask the server for tags pointing to objects we're already
541+ * downloading.
542+ */
543+ GIT_REMOTE_DOWNLOAD_TAGS_AUTO ,
544+ /**
545+ * Don't ask for any tags beyond the refspecs.
546+ */
547+ GIT_REMOTE_DOWNLOAD_TAGS_NONE ,
548+ /**
549+ * Ask for the all the tags.
550+ */
551+ GIT_REMOTE_DOWNLOAD_TAGS_ALL ,
552+ } git_remote_autotag_option_t ;
553+
529554typedef struct {
530555 int version ;
531556
@@ -544,6 +569,15 @@ typedef struct {
544569 * on. Leave this default in order to behave like git.
545570 */
546571 int update_fetchhead ;
572+
573+ /**
574+ * Determines how to behave regarding tags on the remote, such
575+ * as auto-downloading tags for objects we're downloading or
576+ * downloading all of them.
577+ *
578+ * The default is to auto-follow tags.
579+ */
580+ git_remote_autotag_option_t download_tags ;
547581} git_fetch_options ;
548582
549583#define GIT_FETCH_OPTIONS_VERSION 1
@@ -643,12 +677,15 @@ GIT_EXTERN(int) git_remote_upload(git_remote *remote, const git_strarray *refspe
643677 * parameter is ignored when pushing.
644678 * @param callbacks pointer to the callback structure to use
645679 * @param update_fetchhead whether to write to FETCH_HEAD. Pass 1 to behave like git.
680+ * @param download_tags what the behaviour for downloading tags is for this fetch. This is
681+ * ignored for push. This must be the same value passed to `git_remote_download()`.
646682 * @return 0 or an error code
647683 */
648684GIT_EXTERN (int ) git_remote_update_tips (
649685 git_remote * remote ,
650686 const git_remote_callbacks * callbacks ,
651687 int update_fetchhead ,
688+ git_remote_autotag_option_t download_tags ,
652689 const char * reflog_message );
653690
654691/**
@@ -699,17 +736,6 @@ GIT_EXTERN(int) git_remote_push(git_remote *remote,
699736 */
700737GIT_EXTERN (const git_transfer_progress * ) git_remote_stats (git_remote * remote );
701738
702- /**
703- * Automatic tag following option
704- *
705- * Lets us select the --tags option to use.
706- */
707- typedef enum {
708- GIT_REMOTE_DOWNLOAD_TAGS_AUTO = 0 ,
709- GIT_REMOTE_DOWNLOAD_TAGS_NONE = 1 ,
710- GIT_REMOTE_DOWNLOAD_TAGS_ALL = 2
711- } git_remote_autotag_option_t ;
712-
713739/**
714740 * Retrieve the tag auto-follow setting
715741 *
@@ -719,15 +745,16 @@ typedef enum {
719745GIT_EXTERN (git_remote_autotag_option_t ) git_remote_autotag (const git_remote * remote );
720746
721747/**
722- * Set the tag auto-follow setting
748+ * Set the remote's tag following setting.
749+ *
750+ * The change will be made in the configuration. No loaded remotes
751+ * will be affected.
723752 *
724- * @param remote the remote to configure
725- * @param value a GIT_REMOTE_DOWNLOAD_TAGS value
753+ * @param repo the repository in which to make the change
754+ * @param remote the name of the remote
755+ * @param value the new value to take.
726756 */
727- GIT_EXTERN (void ) git_remote_set_autotag (
728- git_remote * remote ,
729- git_remote_autotag_option_t value );
730-
757+ GIT_EXTERN (int ) git_remote_set_autotag (git_repository * repo , const char * remote , git_remote_autotag_option_t value );
731758/**
732759 * Retrieve the ref-prune setting
733760 *
0 commit comments