summaryrefslogtreecommitdiff
path: root/include/git2
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2015-04-22 16:11:10 +0200
committerCarlos Martín Nieto <cmn@dwim.me>2015-05-13 09:46:36 +0200
commit3eff2a57289ec19b1a805dd938299d1dcae47097 (patch)
tree3bd01239ee483c5a8d60768228d9968f2ff90611 /include/git2
parent058b753ceb8f6b25b77e57106b3a87997bc6362a (diff)
downloadlibgit2-3eff2a57289ec19b1a805dd938299d1dcae47097.tar.gz
remote: move the update_fetchhead setting to the options
While this will rarely be different from the default, having it in the remote adds yet another setting it has to keep around and can affect its behaviour. Move it to the options.
Diffstat (limited to 'include/git2')
-rw-r--r--include/git2/remote.h27
1 files changed, 9 insertions, 18 deletions
diff --git a/include/git2/remote.h b/include/git2/remote.h
index 22aad5ad4..5b42a9899 100644
--- a/include/git2/remote.h
+++ b/include/git2/remote.h
@@ -538,10 +538,16 @@ typedef struct {
* Whether to perform a prune after the fetch
*/
git_fetch_prune_t prune;
+
+ /**
+ * Whether to write the results to FETCH_HEAD. Defaults to
+ * on. Leave this default in order to behave like git.
+ */
+ int update_fetchhead;
} git_fetch_options;
#define GIT_FETCH_OPTIONS_VERSION 1
-#define GIT_FETCH_OPTIONS_INIT { GIT_FETCH_OPTIONS_VERSION, GIT_REMOTE_CALLBACKS_INIT }
+#define GIT_FETCH_OPTIONS_INIT { GIT_FETCH_OPTIONS_VERSION, GIT_REMOTE_CALLBACKS_INIT, 0, 1 }
/**
* Initializes a `git_fetch_options` with default values. Equivalent to
@@ -636,11 +642,13 @@ GIT_EXTERN(int) git_remote_upload(git_remote *remote, const git_strarray *refspe
* the name of the remote (or its url, for in-memory remotes). This
* parameter is ignored when pushing.
* @param callbacks pointer to the callback structure to use
+ * @param update_fetchhead whether to write to FETCH_HEAD. Pass 1 to behave like git.
* @return 0 or an error code
*/
GIT_EXTERN(int) git_remote_update_tips(
git_remote *remote,
const git_remote_callbacks *callbacks,
+ int update_fetchhead,
const char *reflog_message);
/**
@@ -755,23 +763,6 @@ GIT_EXTERN(int) git_remote_rename(
const char *new_name);
/**
- * Retrieve the update FETCH_HEAD setting.
- *
- * @param remote the remote to query
- * @return the update FETCH_HEAD setting
- */
-GIT_EXTERN(int) git_remote_update_fetchhead(git_remote *remote);
-
-/**
- * Sets the update FETCH_HEAD setting. By default, FETCH_HEAD will be
- * updated on every fetch. Set to 0 to disable.
- *
- * @param remote the remote to configure
- * @param value 0 to disable updating FETCH_HEAD
- */
-GIT_EXTERN(void) git_remote_set_update_fetchhead(git_remote *remote, int value);
-
-/**
* Ensure the remote name is well-formed.
*
* @param remote_name name to be checked.