remote: add accessors for the autotag setting
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46
diff --git a/include/git2/remote.h b/include/git2/remote.h
index 032bb30..1bca7a7 100644
--- a/include/git2/remote.h
+++ b/include/git2/remote.h
@@ -310,6 +310,23 @@ enum {
GIT_REMOTE_DOWNLOAD_TAGS_AUTO
};
+/**
+ * Retrieve the tag auto-follow setting
+ *
+ * @param remote the remote to query
+ * @return the auto-follow setting
+ */
+GIT_EXTERN(int) git_remote_autotag(git_remote *remote);
+
+/**
+ * Set the tag auto-follow setting
+ *
+ * @param remote the remote to configure
+ * @param value a GIT_REMOTE_DOWNLOAD_TAGS value
+ */
+GIT_EXTERN(void) git_remote_set_autotag(git_remote *remote, int value);
+
+
/** @} */
GIT_END_DECL
#endif
diff --git a/src/remote.c b/src/remote.c
index aef5004..9388cc8 100644
--- a/src/remote.c
+++ b/src/remote.c
@@ -722,3 +722,13 @@ void git_remote_set_callbacks(git_remote *remote, git_remote_callbacks *callback
remote->transport->cb_data = remote->callbacks.data;
}
}
+
+int git_remote_autotag(git_remote *remote)
+{
+ return remote->download_tags;
+}
+
+void git_remote_set_autotag(git_remote *remote, int value)
+{
+ remote->download_tags = value;
+}