Exemplo n.º 1
0
/**
 * ggit_index_entry_is_conflict:
 * @entry: a #GgitIndexEntry.
 *
 * Get whether the entry represents a conflict.
 *
 * Returns: %TRUE if the entry is a conflict, or %FALSE otherwise.
 *
 **/
gboolean
ggit_index_entry_is_conflict (GgitIndexEntry *entry)
{
	g_return_val_if_fail (entry != NULL, FALSE);

	return git_index_entry_is_conflict (entry->entry);
}
Exemplo n.º 2
0
void test_index_conflicts__remove_all_conflicts(void)
{
	size_t i;
	const git_index_entry *entry;

	cl_assert(git_index_entrycount(repo_index) == 8);

	cl_assert_equal_i(true, git_index_has_conflicts(repo_index));

	git_index_conflict_cleanup(repo_index);

	cl_assert_equal_i(false, git_index_has_conflicts(repo_index));

	cl_assert(git_index_entrycount(repo_index) == 2);

	for (i = 0; i < git_index_entrycount(repo_index); i++) {
		cl_assert(entry = git_index_get_byindex(repo_index, i));
		cl_assert(!git_index_entry_is_conflict(entry));
	}
}
Exemplo n.º 3
0
void test_index_conflicts__moved_to_reuc_on_add(void)
{
	const git_index_entry *entry;
	size_t i;

	cl_assert(git_index_entrycount(repo_index) == 8);

	cl_git_mkfile("./mergedrepo/conflicts-one.txt", "new-file\n");

	cl_git_pass(git_index_add_bypath(repo_index, "conflicts-one.txt"));

	cl_assert(git_index_entrycount(repo_index) == 6);

	for (i = 0; i < git_index_entrycount(repo_index); i++) {
		cl_assert(entry = git_index_get_byindex(repo_index, i));

		if (strcmp(entry->path, "conflicts-one.txt") == 0)
			cl_assert(!git_index_entry_is_conflict(entry));
	}
}