コード例 #1
0
ファイル: reuc.c プロジェクト: DaneTheory/libgit2
void test_index_reuc__cleaned_on_checkout_head(void)
{
	git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT;

	opts.checkout_strategy = GIT_CHECKOUT_SAFE | GIT_CHECKOUT_UPDATE_ONLY;

	test_index_reuc__add();
	git_checkout_head(repo, &opts);
	cl_assert(reuc_entry_exists() == false);
}
コード例 #2
0
ファイル: reuc.c プロジェクト: DaneTheory/libgit2
void test_index_reuc__retained_on_checkout_index(void)
{
	git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT;

	opts.checkout_strategy = GIT_CHECKOUT_SAFE | GIT_CHECKOUT_UPDATE_ONLY;

	test_index_reuc__add();
	git_checkout_index(repo, repo_index, &opts);
	cl_assert(reuc_entry_exists() == true);
}
コード例 #3
0
ファイル: reuc.c プロジェクト: DaneTheory/libgit2
void test_index_reuc__cleaned_on_reset_mixed(void)
{
	git_object *target;

	cl_git_pass(git_revparse_single(&target, repo, "3a34580"));

	test_index_reuc__add();
	cl_git_pass(git_reset(repo, target, GIT_RESET_MIXED, NULL, NULL));
	cl_assert(reuc_entry_exists() == false);

	git_object_free(target);
}
コード例 #4
0
ファイル: reuc.c プロジェクト: 0CV0/libgit2
void test_index_reuc__cleaned_on_reset_mixed(void)
{
	git_object *target;

	retrieve_target_from_oid(&target, repo, "3a34580a35add43a4cf361e8e9a30060a905c876");

	test_index_reuc__add();
	cl_git_pass(git_reset(repo, target, GIT_RESET_MIXED));
	cl_assert(reuc_entry_exists() == false);

	git_object_free(target);
}
コード例 #5
0
ファイル: reuc.c プロジェクト: DaneTheory/libgit2
void test_index_reuc__retained_on_reset_soft(void)
{
	git_object *target;

	cl_git_pass(git_revparse_single(&target, repo, "3a34580"));

	git_reset(repo, target, GIT_RESET_HARD, NULL, NULL);

	test_index_reuc__add();
	cl_git_pass(git_reset(repo, target, GIT_RESET_SOFT, NULL, NULL));
	cl_assert(reuc_entry_exists() == true);

	git_object_free(target);
}
コード例 #6
0
ファイル: reuc.c プロジェクト: 0CV0/libgit2
void test_index_reuc__retained_on_reset_soft(void)
{
	git_object *target;

	retrieve_target_from_oid(&target, repo, "3a34580a35add43a4cf361e8e9a30060a905c876");

	git_reset(repo, target, GIT_RESET_HARD);

	test_index_reuc__add();
	cl_git_pass(git_reset(repo, target, GIT_RESET_SOFT));
	cl_assert(reuc_entry_exists() == true);

	git_object_free(target);
}
コード例 #7
0
ファイル: reuc.c プロジェクト: DaneTheory/libgit2
void test_index_reuc__cleaned_on_checkout_tree(void)
{
	git_oid oid;
	git_object *obj;
	git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT;

	opts.checkout_strategy = GIT_CHECKOUT_SAFE | GIT_CHECKOUT_UPDATE_ONLY;

	test_index_reuc__add();
	git_reference_name_to_id(&oid, repo, "refs/heads/master");
	git_object_lookup(&obj, repo, &oid, GIT_OBJ_ANY);
	git_checkout_tree(repo, obj, &opts);
	cl_assert(reuc_entry_exists() == false);

	git_object_free(obj);
}