void test_online_fetchhead__wildcard_spec(void) { fetchhead_test_clone(); fetchhead_test_fetch(NULL, FETCH_HEAD_WILDCARD_DATA2); cl_git_pass(git_tag_delete(g_repo, "annotated_tag")); cl_git_pass(git_tag_delete(g_repo, "blob")); cl_git_pass(git_tag_delete(g_repo, "commit_tree")); cl_git_pass(git_tag_delete(g_repo, "nearly-dangling")); fetchhead_test_fetch(NULL, FETCH_HEAD_WILDCARD_DATA); }
void test_online_fetchhead__colon_only_dst_refspec_creates_no_branch(void) { int refs; fetchhead_test_clone(); refs = count_references(); fetchhead_test_fetch("refs/heads/first-merge:", FETCH_HEAD_EXPLICIT_DATA); cl_assert_equal_i(refs, count_references()); }
void test_online_fetchhead__no_merges(void) { git_config *config; fetchhead_test_clone(); cl_git_pass(git_repository_config(&config, g_repo)); cl_git_pass(git_config_delete_entry(config, "branch.master.remote")); cl_git_pass(git_config_delete_entry(config, "branch.master.merge")); git_config_free(config); fetchhead_test_fetch(NULL, FETCH_HEAD_NO_MERGE_DATA); }
void test_online_fetchhead__empty_dst_refspec_creates_no_branch(void) { git_reference *ref; int refs; fetchhead_test_clone(); refs = count_references(); fetchhead_test_fetch("refs/heads/first-merge", FETCH_HEAD_EXPLICIT_DATA); cl_git_fail(git_branch_lookup(&ref, g_repo, "first-merge", GIT_BRANCH_ALL)); cl_assert_equal_i(refs, count_references()); }
void test_online_fetchhead__explicit_dst_refspec_creates_branch(void) { git_reference *ref; int refs; fetchhead_test_clone(); refs = count_references(); fetchhead_test_fetch("refs/heads/first-merge:refs/heads/explicit-refspec", FETCH_HEAD_EXPLICIT_DATA); cl_git_pass(git_branch_lookup(&ref, g_repo, "explicit-refspec", GIT_BRANCH_ALL)); cl_assert_equal_i(refs + 1, count_references()); git_reference_free(ref); }
void test_online_fetchhead__no_merges(void) { git_config *config; fetchhead_test_clone(); cl_git_pass(git_repository_config(&config, g_repo)); cl_git_pass(git_config_delete_entry(config, "branch.master.remote")); cl_git_pass(git_config_delete_entry(config, "branch.master.merge")); git_config_free(config); fetchhead_test_fetch(NULL, FETCH_HEAD_NO_MERGE_DATA2); cl_git_pass(git_tag_delete(g_repo, "annotated_tag")); cl_git_pass(git_tag_delete(g_repo, "blob")); cl_git_pass(git_tag_delete(g_repo, "commit_tree")); cl_git_pass(git_tag_delete(g_repo, "nearly-dangling")); fetchhead_test_fetch(NULL, FETCH_HEAD_NO_MERGE_DATA); cl_git_pass(git_tag_delete(g_repo, "commit_tree")); fetchhead_test_fetch(NULL, FETCH_HEAD_NO_MERGE_DATA3); }
void test_online_fetchhead__explicit_spec(void) { fetchhead_test_clone(); fetchhead_test_fetch("refs/heads/first-merge:refs/remotes/origin/first-merge", FETCH_HEAD_EXPLICIT_DATA); }
void test_online_fetchhead__wildcard_spec(void) { fetchhead_test_clone(); fetchhead_test_fetch(NULL, FETCH_HEAD_WILDCARD_DATA); }