Commit 7b6e1e4cc668e0c9774d8149bdddd10ac7deeed5

Carlos Martín Nieto 2014-12-14T20:40:52

fetch: add test for the other order of overlapping specs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
diff --git a/tests/network/fetchlocal.c b/tests/network/fetchlocal.c
index a278da3..e2e6b5e 100644
--- a/tests/network/fetchlocal.c
+++ b/tests/network/fetchlocal.c
@@ -180,6 +180,15 @@ void test_network_fetchlocal__prune_overlapping(void)
 	cl_git_pass(git_reference_list(&refnames, repo));
 	cl_assert_equal_i(20, (int)refnames.count);
 
+	cl_git_pass(git_config_delete_multivar(config, "remote.origin.fetch", "refs"));
+	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));
+
 	cl_git_pass(git_reference_delete(ref));
 	cl_git_pass(git_config_delete_multivar(config, "remote.origin.fetch", "refs"));
 	cl_git_pass(git_config_set_multivar(config, "remote.origin.fetch", "^$", "refs/heads/*:refs/remotes/origin/*"));