summaryrefslogtreecommitdiff
path: root/tests-clar
diff options
context:
space:
mode:
authorVicent Martí <vicent@github.com>2012-10-22 12:04:48 -0700
committerVicent Martí <vicent@github.com>2012-10-22 12:04:48 -0700
commit8a89aa1f57fc0b352800bc77e228554fe95caddd (patch)
tree910f462e7cd550db7a6e21b79c86f2583937421c /tests-clar
parent40846f3d9ade6a6b83cb894e76187c967500cae8 (diff)
parentc648d4a8aac447120aed623cd1606fddeb435800 (diff)
downloadlibgit2-8a89aa1f57fc0b352800bc77e228554fe95caddd.tar.gz
Merge pull request #963 from carlosmn/remote-save-autotag
Save the autotag configuration for remotes
Diffstat (limited to 'tests-clar')
-rw-r--r--tests-clar/network/remotes.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/tests-clar/network/remotes.c b/tests-clar/network/remotes.c
index c7ee863e7..91c3e879d 100644
--- a/tests-clar/network/remotes.c
+++ b/tests-clar/network/remotes.c
@@ -225,3 +225,27 @@ void test_network_remotes__add(void)
cl_assert(!strcmp(git_refspec_dst(_refspec), "refs/remotes/addtest/*"));
cl_assert_equal_s(git_remote_url(_remote), "http://github.com/libgit2/libgit2");
}
+
+void test_network_remotes__tagopt(void)
+{
+ const char *opt;
+ git_config *cfg;
+
+ cl_git_pass(git_repository_config(&cfg, _repo));
+
+ git_remote_set_autotag(_remote, GIT_REMOTE_DOWNLOAD_TAGS_ALL);
+ cl_git_pass(git_remote_save(_remote));
+ cl_git_pass(git_config_get_string(&opt, cfg, "remote.test.tagopt"));
+ cl_assert(!strcmp(opt, "--tags"));
+
+ git_remote_set_autotag(_remote, GIT_REMOTE_DOWNLOAD_TAGS_NONE);
+ cl_git_pass(git_remote_save(_remote));
+ cl_git_pass(git_config_get_string(&opt, cfg, "remote.test.tagopt"));
+ cl_assert(!strcmp(opt, "--no-tags"));
+
+ git_remote_set_autotag(_remote, GIT_REMOTE_DOWNLOAD_TAGS_AUTO);
+ cl_git_pass(git_remote_save(_remote));
+ cl_assert(git_config_get_string(&opt, cfg, "remote.test.tagopt") == GIT_ENOTFOUND);
+
+ git_config_free(cfg);
+}