Commit 49ebc8a7 by Yoichi Nakayama

Add a branch with a empty reflog into testrepo.git

parent 9b04a307
...@@ -508,7 +508,7 @@ void test_fetchhead_nonetwork__create_with_multiple_refspecs(void) ...@@ -508,7 +508,7 @@ void test_fetchhead_nonetwork__create_with_multiple_refspecs(void)
int i; int i;
struct prefix_count prefix_counts[] = { struct prefix_count prefix_counts[] = {
{"refs/notes/", 0, 1}, {"refs/notes/", 0, 1},
{"refs/heads/", 0, 12}, {"refs/heads/", 0, 13},
{"refs/tags/", 0, 7}, {"refs/tags/", 0, 7},
{NULL, 0, 0}, {NULL, 0, 0},
}; };
......
...@@ -45,7 +45,7 @@ void test_network_fetchlocal__complete(void) ...@@ -45,7 +45,7 @@ void test_network_fetchlocal__complete(void)
cl_git_pass(git_remote_fetch(origin, NULL, &options, NULL)); cl_git_pass(git_remote_fetch(origin, NULL, &options, NULL));
cl_git_pass(git_reference_list(&refnames, repo)); cl_git_pass(git_reference_list(&refnames, repo));
cl_assert_equal_i(19, (int)refnames.count); cl_assert_equal_i(20, (int)refnames.count);
cl_assert(callcount > 0); cl_assert(callcount > 0);
git_strarray_dispose(&refnames); git_strarray_dispose(&refnames);
...@@ -74,7 +74,7 @@ void test_network_fetchlocal__prune(void) ...@@ -74,7 +74,7 @@ void test_network_fetchlocal__prune(void)
cl_git_pass(git_remote_fetch(origin, NULL, &options, NULL)); cl_git_pass(git_remote_fetch(origin, NULL, &options, NULL));
cl_git_pass(git_reference_list(&refnames, repo)); cl_git_pass(git_reference_list(&refnames, repo));
cl_assert_equal_i(19, (int)refnames.count); cl_assert_equal_i(20, (int)refnames.count);
cl_assert(callcount > 0); cl_assert(callcount > 0);
git_strarray_dispose(&refnames); git_strarray_dispose(&refnames);
git_remote_free(origin); git_remote_free(origin);
...@@ -88,7 +88,7 @@ void test_network_fetchlocal__prune(void) ...@@ -88,7 +88,7 @@ void test_network_fetchlocal__prune(void)
cl_git_pass(git_remote_prune(origin, &options.callbacks)); cl_git_pass(git_remote_prune(origin, &options.callbacks));
cl_git_pass(git_reference_list(&refnames, repo)); cl_git_pass(git_reference_list(&refnames, repo));
cl_assert_equal_i(18, (int)refnames.count); cl_assert_equal_i(19, (int)refnames.count);
git_strarray_dispose(&refnames); git_strarray_dispose(&refnames);
git_remote_free(origin); git_remote_free(origin);
...@@ -101,7 +101,7 @@ void test_network_fetchlocal__prune(void) ...@@ -101,7 +101,7 @@ void test_network_fetchlocal__prune(void)
cl_git_pass(git_remote_prune(origin, &options.callbacks)); cl_git_pass(git_remote_prune(origin, &options.callbacks));
cl_git_pass(git_reference_list(&refnames, repo)); cl_git_pass(git_reference_list(&refnames, repo));
cl_assert_equal_i(17, (int)refnames.count); cl_assert_equal_i(18, (int)refnames.count);
git_strarray_dispose(&refnames); git_strarray_dispose(&refnames);
git_remote_free(origin); git_remote_free(origin);
...@@ -166,7 +166,7 @@ void test_network_fetchlocal__prune_overlapping(void) ...@@ -166,7 +166,7 @@ void test_network_fetchlocal__prune_overlapping(void)
assert_ref_exists(repo, "refs/remotes/origin/master"); assert_ref_exists(repo, "refs/remotes/origin/master");
assert_ref_exists(repo, "refs/remotes/origin/pr/42"); assert_ref_exists(repo, "refs/remotes/origin/pr/42");
cl_git_pass(git_reference_list(&refnames, repo)); cl_git_pass(git_reference_list(&refnames, repo));
cl_assert_equal_i(20, (int)refnames.count); cl_assert_equal_i(21, (int)refnames.count);
git_strarray_dispose(&refnames); git_strarray_dispose(&refnames);
cl_git_pass(git_config_delete_multivar(config, "remote.origin.fetch", "refs")); cl_git_pass(git_config_delete_multivar(config, "remote.origin.fetch", "refs"));
...@@ -181,7 +181,7 @@ void test_network_fetchlocal__prune_overlapping(void) ...@@ -181,7 +181,7 @@ void test_network_fetchlocal__prune_overlapping(void)
assert_ref_exists(repo, "refs/remotes/origin/master"); assert_ref_exists(repo, "refs/remotes/origin/master");
assert_ref_exists(repo, "refs/remotes/origin/pr/42"); assert_ref_exists(repo, "refs/remotes/origin/pr/42");
cl_git_pass(git_reference_list(&refnames, repo)); cl_git_pass(git_reference_list(&refnames, repo));
cl_assert_equal_i(20, (int)refnames.count); cl_assert_equal_i(21, (int)refnames.count);
git_strarray_dispose(&refnames); git_strarray_dispose(&refnames);
cl_git_pass(git_config_delete_multivar(config, "remote.origin.fetch", "refs")); cl_git_pass(git_config_delete_multivar(config, "remote.origin.fetch", "refs"));
...@@ -221,7 +221,7 @@ void test_network_fetchlocal__fetchprune(void) ...@@ -221,7 +221,7 @@ void test_network_fetchlocal__fetchprune(void)
cl_git_pass(git_remote_fetch(origin, NULL, &options, NULL)); cl_git_pass(git_remote_fetch(origin, NULL, &options, NULL));
cl_git_pass(git_reference_list(&refnames, repo)); cl_git_pass(git_reference_list(&refnames, repo));
cl_assert_equal_i(19, (int)refnames.count); cl_assert_equal_i(20, (int)refnames.count);
cl_assert(callcount > 0); cl_assert(callcount > 0);
git_strarray_dispose(&refnames); git_strarray_dispose(&refnames);
git_remote_free(origin); git_remote_free(origin);
...@@ -235,7 +235,7 @@ void test_network_fetchlocal__fetchprune(void) ...@@ -235,7 +235,7 @@ void test_network_fetchlocal__fetchprune(void)
cl_git_pass(git_remote_prune(origin, &options.callbacks)); cl_git_pass(git_remote_prune(origin, &options.callbacks));
cl_git_pass(git_reference_list(&refnames, repo)); cl_git_pass(git_reference_list(&refnames, repo));
cl_assert_equal_i(18, (int)refnames.count); cl_assert_equal_i(19, (int)refnames.count);
git_strarray_dispose(&refnames); git_strarray_dispose(&refnames);
git_remote_free(origin); git_remote_free(origin);
...@@ -251,7 +251,7 @@ void test_network_fetchlocal__fetchprune(void) ...@@ -251,7 +251,7 @@ void test_network_fetchlocal__fetchprune(void)
cl_git_pass(git_remote_fetch(origin, NULL, &options, NULL)); cl_git_pass(git_remote_fetch(origin, NULL, &options, NULL));
cl_git_pass(git_reference_list(&refnames, repo)); cl_git_pass(git_reference_list(&refnames, repo));
cl_assert_equal_i(17, (int)refnames.count); cl_assert_equal_i(18, (int)refnames.count);
git_strarray_dispose(&refnames); git_strarray_dispose(&refnames);
git_remote_free(origin); git_remote_free(origin);
...@@ -335,7 +335,7 @@ void test_network_fetchlocal__partial(void) ...@@ -335,7 +335,7 @@ void test_network_fetchlocal__partial(void)
git_strarray_dispose(&refnames); git_strarray_dispose(&refnames);
cl_git_pass(git_reference_list(&refnames, repo)); cl_git_pass(git_reference_list(&refnames, repo));
cl_assert_equal_i(20, (int)refnames.count); /* 18 remote + 1 local */ cl_assert_equal_i(21, (int)refnames.count); /* 18 remote + 1 local */
cl_assert(callcount > 0); cl_assert(callcount > 0);
git_strarray_dispose(&refnames); git_strarray_dispose(&refnames);
...@@ -418,7 +418,7 @@ void test_network_fetchlocal__multi_remotes(void) ...@@ -418,7 +418,7 @@ void test_network_fetchlocal__multi_remotes(void)
cl_git_pass(git_remote_fetch(test, NULL, &options, NULL)); cl_git_pass(git_remote_fetch(test, NULL, &options, NULL));
cl_git_pass(git_reference_list(&refnames, repo)); cl_git_pass(git_reference_list(&refnames, repo));
cl_assert_equal_i(33, (int)refnames.count); cl_assert_equal_i(35, (int)refnames.count);
git_strarray_dispose(&refnames); git_strarray_dispose(&refnames);
cl_git_pass(git_remote_set_url(repo, "test_with_pushurl", cl_git_fixture_url("testrepo.git"))); cl_git_pass(git_remote_set_url(repo, "test_with_pushurl", cl_git_fixture_url("testrepo.git")));
...@@ -426,7 +426,7 @@ void test_network_fetchlocal__multi_remotes(void) ...@@ -426,7 +426,7 @@ void test_network_fetchlocal__multi_remotes(void)
cl_git_pass(git_remote_fetch(test2, NULL, &options, NULL)); cl_git_pass(git_remote_fetch(test2, NULL, &options, NULL));
cl_git_pass(git_reference_list(&refnames, repo)); cl_git_pass(git_reference_list(&refnames, repo));
cl_assert_equal_i(45, (int)refnames.count); cl_assert_equal_i(48, (int)refnames.count);
git_strarray_dispose(&refnames); git_strarray_dispose(&refnames);
git_remote_free(test); git_remote_free(test);
......
...@@ -61,7 +61,7 @@ void test_network_remote_local__retrieve_advertised_references(void) ...@@ -61,7 +61,7 @@ void test_network_remote_local__retrieve_advertised_references(void)
cl_git_pass(git_remote_ls(&refs, &refs_len, remote)); cl_git_pass(git_remote_ls(&refs, &refs_len, remote));
cl_assert_equal_i(refs_len, 29); cl_assert_equal_i(refs_len, 30);
} }
void test_network_remote_local__retrieve_advertised_before_connect(void) void test_network_remote_local__retrieve_advertised_before_connect(void)
...@@ -85,7 +85,7 @@ void test_network_remote_local__retrieve_advertised_references_after_disconnect( ...@@ -85,7 +85,7 @@ void test_network_remote_local__retrieve_advertised_references_after_disconnect(
cl_git_pass(git_remote_ls(&refs, &refs_len, remote)); cl_git_pass(git_remote_ls(&refs, &refs_len, remote));
cl_assert_equal_i(refs_len, 29); cl_assert_equal_i(refs_len, 30);
} }
void test_network_remote_local__retrieve_advertised_references_from_spaced_repository(void) void test_network_remote_local__retrieve_advertised_references_from_spaced_repository(void)
...@@ -100,7 +100,7 @@ void test_network_remote_local__retrieve_advertised_references_from_spaced_repos ...@@ -100,7 +100,7 @@ void test_network_remote_local__retrieve_advertised_references_from_spaced_repos
cl_git_pass(git_remote_ls(&refs, &refs_len, remote)); cl_git_pass(git_remote_ls(&refs, &refs_len, remote));
cl_assert_equal_i(refs_len, 29); cl_assert_equal_i(refs_len, 30);
git_remote_free(remote); /* Disconnect from the "spaced repo" before the cleanup */ git_remote_free(remote); /* Disconnect from the "spaced repo" before the cleanup */
remote = NULL; remote = NULL;
......
...@@ -48,7 +48,7 @@ static void assert_retrieval(unsigned int flags, unsigned int expected_count) ...@@ -48,7 +48,7 @@ static void assert_retrieval(unsigned int flags, unsigned int expected_count)
void test_refs_branches_iterator__retrieve_all_branches(void) void test_refs_branches_iterator__retrieve_all_branches(void)
{ {
assert_retrieval(GIT_BRANCH_ALL, 14); assert_retrieval(GIT_BRANCH_ALL, 15);
} }
void test_refs_branches_iterator__retrieve_remote_branches(void) void test_refs_branches_iterator__retrieve_remote_branches(void)
...@@ -58,7 +58,7 @@ void test_refs_branches_iterator__retrieve_remote_branches(void) ...@@ -58,7 +58,7 @@ void test_refs_branches_iterator__retrieve_remote_branches(void)
void test_refs_branches_iterator__retrieve_local_branches(void) void test_refs_branches_iterator__retrieve_local_branches(void)
{ {
assert_retrieval(GIT_BRANCH_LOCAL, 12); assert_retrieval(GIT_BRANCH_LOCAL, 13);
} }
struct expectations { struct expectations {
......
...@@ -48,8 +48,8 @@ static void assert_retrieval(const char *glob, int expected_count) ...@@ -48,8 +48,8 @@ static void assert_retrieval(const char *glob, int expected_count)
void test_refs_foreachglob__retrieve_all_refs(void) void test_refs_foreachglob__retrieve_all_refs(void)
{ {
/* 12 heads (including one packed head) + 1 note + 2 remotes + 7 tags + 1 blob */ /* 13 heads (including one packed head) + 1 note + 2 remotes + 7 tags + 1 blob */
assert_retrieval("*", 23); assert_retrieval("*", 24);
} }
void test_refs_foreachglob__retrieve_remote_branches(void) void test_refs_foreachglob__retrieve_remote_branches(void)
...@@ -59,7 +59,7 @@ void test_refs_foreachglob__retrieve_remote_branches(void) ...@@ -59,7 +59,7 @@ void test_refs_foreachglob__retrieve_remote_branches(void)
void test_refs_foreachglob__retrieve_local_branches(void) void test_refs_foreachglob__retrieve_local_branches(void)
{ {
assert_retrieval("refs/heads/*", 12); assert_retrieval("refs/heads/*", 13);
} }
void test_refs_foreachglob__retrieve_nonexistant(void) void test_refs_foreachglob__retrieve_nonexistant(void)
......
...@@ -28,6 +28,7 @@ static const char *refnames[] = { ...@@ -28,6 +28,7 @@ static const char *refnames[] = {
"refs/heads/test", "refs/heads/test",
"refs/heads/track-local", "refs/heads/track-local",
"refs/heads/trailing", "refs/heads/trailing",
"refs/heads/with-empty-log",
"refs/notes/fanout", "refs/notes/fanout",
"refs/remotes/test/master", "refs/remotes/test/master",
"refs/tags/annotated_tag_to_blob", "refs/tags/annotated_tag_to_blob",
...@@ -58,6 +59,7 @@ static const char *refnames_with_symlink[] = { ...@@ -58,6 +59,7 @@ static const char *refnames_with_symlink[] = {
"refs/heads/test", "refs/heads/test",
"refs/heads/track-local", "refs/heads/track-local",
"refs/heads/trailing", "refs/heads/trailing",
"refs/heads/with-empty-log",
"refs/notes/fanout", "refs/notes/fanout",
"refs/remotes/test/master", "refs/remotes/test/master",
"refs/tags/annotated_tag_to_blob", "refs/tags/annotated_tag_to_blob",
......
8496071c1b46c854b31185ea97743be6a8774479
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