本文整理汇总了C++中cl_git_sandbox_cleanup函数的典型用法代码示例。如果您正苦于以下问题:C++ cl_git_sandbox_cleanup函数的具体用法?C++ cl_git_sandbox_cleanup怎么用?C++ cl_git_sandbox_cleanup使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了cl_git_sandbox_cleanup函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: test_reset_hard__cleanup
void test_reset_hard__cleanup(void)
{
git_object_free(target);
target = NULL;
cl_git_sandbox_cleanup();
}
示例2: test_status_ignore__filenames_with_special_prefixes_do_not_interfere_with_status_retrieval
void test_status_ignore__filenames_with_special_prefixes_do_not_interfere_with_status_retrieval(void)
{
status_entry_single st;
char *test_cases[] = {
"!file",
"#blah",
"[blah]",
"[attr]",
"[attr]blah",
NULL
};
int i;
for (i = 0; *(test_cases + i) != NULL; i++) {
git_buf file = GIT_BUF_INIT;
char *file_name = *(test_cases + i);
git_repository *repo = cl_git_sandbox_init("empty_standard_repo");
cl_git_pass(git_buf_joinpath(&file, "empty_standard_repo", file_name));
cl_git_mkfile(git_buf_cstr(&file), "Please don't ignore me!");
memset(&st, 0, sizeof(st));
cl_git_pass(git_status_foreach(repo, cb_status__single, &st));
cl_assert(st.count == 1);
cl_assert(st.status == GIT_STATUS_WT_NEW);
cl_git_pass(git_status_file(&st.status, repo, file_name));
cl_assert(st.status == GIT_STATUS_WT_NEW);
cl_git_sandbox_cleanup();
git_buf_free(&file);
}
}
示例3: test_diff_submodules__cleanup
void test_diff_submodules__cleanup(void)
{
cl_git_sandbox_cleanup();
cl_fixture_cleanup("testrepo.git");
cl_fixture_cleanup("submod2_target");
}
示例4: test_index_names__cleanup
void test_index_names__cleanup(void)
{
git_index_free(repo_index);
repo_index = NULL;
cl_git_sandbox_cleanup();
}
示例5: test_describe_describe__describe_a_repo_with_no_refs
void test_describe_describe__describe_a_repo_with_no_refs(void)
{
git_repository *repo;
git_describe_options opts = GIT_DESCRIBE_OPTIONS_INIT;
git_buf buf = GIT_BUF_INIT;
git_object *object;
git_describe_result *result = NULL;
repo = cl_git_sandbox_init("testrepo.git");
cl_git_pass(git_revparse_single(&object, repo, "HEAD"));
cl_git_pass(git_reference_foreach(repo, delete_cb, NULL));
/* Impossible to describe without falling back to OIDs */
cl_git_fail(git_describe_commit(&result, object, &opts));
/* Try again with OID fallbacks */
opts.show_commit_oid_as_fallback = 1;
cl_git_pass(git_describe_commit(&result, object, &opts));
git_describe_result_free(result);
git_object_free(object);
git_buf_free(&buf);
cl_git_sandbox_cleanup();
}
示例6: test_refs_revparse__reflog_of_a_ref_under_refs
void test_refs_revparse__reflog_of_a_ref_under_refs(void)
{
git_repository *repo = cl_git_sandbox_init("testrepo.git");
test_object_inrepo("refs/fakestash", NULL, repo);
create_fake_stash_reference_and_reflog(repo);
/*
* $ git reflog -1 refs/fakestash
* a65fedf refs/[email protected]{0}: commit: checking in
*
* $ git reflog -1 refs/[email protected]{0}
* a65fedf refs/[email protected]{0}: commit: checking in
*
* $ git reflog -1 fakestash
* a65fedf [email protected]{0}: commit: checking in
*
* $ git reflog -1 [email protected]{0}
* a65fedf [email protected]{0}: commit: checking in
*/
test_object_inrepo("refs/fakestash", "a65fedf39aefe402d3bb6e24df4d4f5fe4547750", repo);
test_object_inrepo("refs/[email protected]{0}", "a65fedf39aefe402d3bb6e24df4d4f5fe4547750", repo);
test_object_inrepo("fakestash", "a65fedf39aefe402d3bb6e24df4d4f5fe4547750", repo);
test_object_inrepo("[email protected]{0}", "a65fedf39aefe402d3bb6e24df4d4f5fe4547750", repo);
cl_git_sandbox_cleanup();
}
示例7: test_refs_revparse__issue_994
void test_refs_revparse__issue_994(void)
{
git_repository *repo;
git_reference *head, *with_at;
git_object *target;
repo = cl_git_sandbox_init("testrepo.git");
cl_assert_equal_i(GIT_ENOTFOUND,
git_revparse_single(&target, repo, "origin/[email protected]"));
cl_assert_equal_i(GIT_ENOTFOUND,
git_revparse_single(&target, repo, "refs/remotes/origin/[email protected]"));
cl_git_pass(git_repository_head(&head, repo));
cl_git_pass(git_reference_create(
&with_at,
repo,
"refs/remotes/origin/[email protected]",
git_reference_target(head),
0));
cl_git_pass(git_revparse_single(&target, repo, "origin/[email protected]"));
git_object_free(target);
cl_git_pass(git_revparse_single(&target, repo, "refs/remotes/origin/[email protected]"));
git_object_free(target);
git_reference_free(with_at);
git_reference_free(head);
cl_git_sandbox_cleanup();
}
示例8: test_network_remote_local__push_delete
void test_network_remote_local__push_delete(void)
{
git_repository *src_repo;
git_repository *dst_repo;
git_remote *remote;
git_reference *ref;
char *spec_push[] = { "refs/heads/master" };
char *spec_delete[] = { ":refs/heads/master" };
git_strarray specs = {
spec_push,
1,
};
src_repo = cl_git_sandbox_init("testrepo.git");
cl_git_pass(git_repository_init(&dst_repo, "target.git", 1));
cl_git_pass(git_remote_create(&remote, src_repo, "origin", "./target.git"));
/* Push the master branch and verify it's there */
cl_git_pass(git_remote_push(remote, &specs, NULL));
cl_git_pass(git_reference_lookup(&ref, dst_repo, "refs/heads/master"));
git_reference_free(ref);
specs.strings = spec_delete;
cl_git_pass(git_remote_push(remote, &specs, NULL));
cl_git_fail(git_reference_lookup(&ref, dst_repo, "refs/heads/master"));
git_remote_free(remote);
git_repository_free(dst_repo);
cl_fixture_cleanup("target.git");
cl_git_sandbox_cleanup();
}
示例9: cleanup_fixture_submodules
static void cleanup_fixture_submodules(void *payload)
{
cl_git_sandbox_cleanup(); /* either "submodules" or "submod2" */
if (payload)
cl_fixture_cleanup(payload);
}
示例10: test_repo_open__cleanup
void test_repo_open__cleanup(void)
{
cl_git_sandbox_cleanup();
if (git_path_isdir("alternate"))
git_futils_rmdir_r("alternate", NULL, GIT_RMDIR_REMOVE_FILES);
}
示例11: test_refs_create__cleanup
void test_refs_create__cleanup(void)
{
cl_git_sandbox_cleanup();
cl_git_pass(git_libgit2_opts(GIT_OPT_ENABLE_STRICT_OBJECT_CREATION, 1));
cl_git_pass(git_libgit2_opts(GIT_OPT_ENABLE_STRICT_SYMBOLIC_REF_CREATION, 1));
cl_git_pass(git_libgit2_opts(GIT_OPT_ENABLE_SYNCHRONOUS_OBJECT_CREATION, 0));
}
示例12: test_threads_diff__cleanup
void test_threads_diff__cleanup(void)
{
cl_git_sandbox_cleanup();
#ifdef GIT_WIN32
git_win32__retries = _retries;
#endif
}
示例13: test_checkout_index__cleanup
void test_checkout_index__cleanup(void)
{
cl_git_sandbox_cleanup();
/* try to remove alternative dir */
if (git_path_isdir("alternative"))
git_futils_rmdir_r("alternative", NULL, GIT_RMDIR_REMOVE_FILES);
}
示例14: test_network_remote_defaultbranch__cleanup
void test_network_remote_defaultbranch__cleanup(void)
{
git_remote_free(g_remote);
git_repository_free(g_repo_b);
cl_git_sandbox_cleanup();
cl_fixture_cleanup("repo-b.git");
}
示例15: test_refs_branches_delete__cleanup
void test_refs_branches_delete__cleanup(void)
{
git_reference_free(fake_remote);
fake_remote = NULL;
cl_git_sandbox_cleanup();
repo = NULL;
}