Commit 26186b15 by Carlos Martín Nieto

fetch: remove the prune setter

This option does not get persisted to disk, which makes it different
from the rest of the setters. Remove it until we go all the way.

We still respect the configuration option, and it's still possible to
perform a one-time prune by calling the function.
parent 7b6e1e4c
......@@ -601,16 +601,6 @@ GIT_EXTERN(void) git_remote_set_autotag(
GIT_EXTERN(int) git_remote_prune_refs(const git_remote *remote);
/**
* Set the ref-prune setting
*
* @param remote the remote to configure
* @param value a boolean value
*/
GIT_EXTERN(void) git_remote_set_prune_refs(
git_remote *remote,
int value);
/**
* Give the remote a new name
*
* All remote-tracking branches and configuration settings
......
......@@ -1632,11 +1632,6 @@ int git_remote_prune_refs(const git_remote *remote)
return remote->prune_refs;
}
void git_remote_set_prune_refs(git_remote *remote, int value)
{
remote->prune_refs = value;
}
static int rename_remote_config_section(
git_repository *repo,
const char *old_name,
......
......@@ -153,10 +153,10 @@ void test_network_fetchlocal__prune_overlapping(void)
git_remote_set_callbacks(origin, &callbacks);
cl_git_pass(git_repository_config(&config, repo));
cl_git_pass(git_config_set_bool(config, "remote.origin.prune", true));
cl_git_pass(git_config_set_multivar(config, "remote.origin.fetch", "^$", "refs/pull/*/head:refs/remotes/origin/pr/*"));
cl_git_pass(git_remote_lookup(&origin, repo, GIT_REMOTE_ORIGIN));
git_remote_set_prune_refs(origin, 1);
git_remote_set_callbacks(origin, &callbacks);
cl_git_pass(git_remote_fetch(origin, NULL, NULL, NULL));
......@@ -170,7 +170,6 @@ void test_network_fetchlocal__prune_overlapping(void)
cl_git_pass(git_config_set_multivar(config, "remote.origin.fetch", "^$", "refs/heads/*:refs/remotes/origin/*"));
cl_git_pass(git_remote_lookup(&origin, repo, GIT_REMOTE_ORIGIN));
git_remote_set_prune_refs(origin, true);
callbacks.update_tips = update_tips_fail_on_call;
git_remote_set_callbacks(origin, &callbacks);
cl_git_pass(git_remote_fetch(origin, NULL, NULL, NULL));
......@@ -184,7 +183,6 @@ void test_network_fetchlocal__prune_overlapping(void)
cl_git_pass(git_config_set_multivar(config, "remote.origin.fetch", "^$", "refs/heads/*:refs/remotes/origin/*"));
cl_git_pass(git_config_set_multivar(config, "remote.origin.fetch", "^$", "refs/pull/*/head:refs/remotes/origin/pr/*"));
cl_git_pass(git_remote_lookup(&origin, repo, GIT_REMOTE_ORIGIN));
git_remote_set_prune_refs(origin, true);
callbacks.update_tips = update_tips_fail_on_call;
git_remote_set_callbacks(origin, &callbacks);
cl_git_pass(git_remote_fetch(origin, NULL, NULL, NULL));
......@@ -234,9 +232,9 @@ void test_network_fetchlocal__fetchprune(void)
git_reference_free(ref);
cl_git_pass(git_remote_lookup(&origin, repo, GIT_REMOTE_ORIGIN));
git_remote_set_prune_refs(origin, 1);
git_remote_set_callbacks(origin, &callbacks);
cl_git_pass(git_remote_fetch(origin, NULL, NULL, NULL));
cl_git_pass(git_remote_prune(origin));
cl_git_pass(git_reference_list(&refnames, repo));
cl_assert_equal_i(18, (int)refnames.count);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment