summaryrefslogtreecommitdiff
path: root/tests/checkout/conflict.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/checkout/conflict.c')
-rw-r--r--tests/checkout/conflict.c43
1 files changed, 25 insertions, 18 deletions
diff --git a/tests/checkout/conflict.c b/tests/checkout/conflict.c
index 66965a89b..2cb7c224d 100644
--- a/tests/checkout/conflict.c
+++ b/tests/checkout/conflict.c
@@ -61,12 +61,19 @@ struct checkout_name_entry {
void test_checkout_conflict__initialize(void)
{
+ git_config *cfg;
+
g_repo = cl_git_sandbox_init(TEST_REPO_PATH);
git_repository_index(&g_index, g_repo);
cl_git_rewritefile(
TEST_REPO_PATH "/.gitattributes",
"* text eol=lf\n");
+
+ /* Ensure that the user's merge.conflictstyle doesn't interfere */
+ cl_git_pass(git_repository_config(&cfg, g_repo));
+ cl_git_pass(git_config_set_string(cfg, "merge.conflictstyle", "merge"));
+ git_config_free(cfg);
}
void test_checkout_conflict__cleanup(void)
@@ -96,7 +103,7 @@ static void create_index(struct checkout_index_entry *entries, size_t entries_le
entry.mode = entries[i].mode;
entry.flags = entries[i].stage << GIT_IDXENTRY_STAGESHIFT;
- git_oid_fromstr(&entry.oid, entries[i].oid_str);
+ git_oid_fromstr(&entry.id, entries[i].oid_str);
entry.path = entries[i].path;
cl_git_pass(git_index_add(g_index, &entry));
@@ -200,7 +207,7 @@ static void ensure_workdir_link(const char *path, const char *target)
void test_checkout_conflict__ignored(void)
{
- git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT;
+ git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT;
opts.checkout_strategy |= GIT_CHECKOUT_SKIP_UNMERGED;
@@ -214,7 +221,7 @@ void test_checkout_conflict__ignored(void)
void test_checkout_conflict__ours(void)
{
- git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT;
+ git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT;
opts.checkout_strategy |= GIT_CHECKOUT_USE_OURS;
@@ -227,7 +234,7 @@ void test_checkout_conflict__ours(void)
void test_checkout_conflict__theirs(void)
{
- git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT;
+ git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT;
opts.checkout_strategy |= GIT_CHECKOUT_USE_THEIRS;
@@ -241,7 +248,7 @@ void test_checkout_conflict__theirs(void)
void test_checkout_conflict__diff3(void)
{
- git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT;
+ git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT;
create_conflicting_index();
@@ -252,7 +259,7 @@ void test_checkout_conflict__diff3(void)
void test_checkout_conflict__automerge(void)
{
- git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT;
+ git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT;
struct checkout_index_entry checkout_index_entries[] = {
{ 0100644, AUTOMERGEABLE_ANCESTOR_OID, 1, "automergeable.txt" },
@@ -270,7 +277,7 @@ void test_checkout_conflict__automerge(void)
void test_checkout_conflict__directory_file(void)
{
- git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT;
+ git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT;
struct checkout_index_entry checkout_index_entries[] = {
{ 0100644, CONFLICTING_ANCESTOR_OID, 1, "df-1" },
@@ -309,7 +316,7 @@ void test_checkout_conflict__directory_file(void)
void test_checkout_conflict__directory_file_with_custom_labels(void)
{
- git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT;
+ git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT;
struct checkout_index_entry checkout_index_entries[] = {
{ 0100644, CONFLICTING_ANCESTOR_OID, 1, "df-1" },
@@ -350,7 +357,7 @@ void test_checkout_conflict__directory_file_with_custom_labels(void)
void test_checkout_conflict__link_file(void)
{
- git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT;
+ git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT;
struct checkout_index_entry checkout_index_entries[] = {
{ 0100644, CONFLICTING_ANCESTOR_OID, 1, "link-1" },
@@ -386,7 +393,7 @@ void test_checkout_conflict__link_file(void)
void test_checkout_conflict__links(void)
{
- git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT;
+ git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT;
struct checkout_index_entry checkout_index_entries[] = {
{ 0120000, LINK_ANCESTOR_OID, 1, "link-1" },
@@ -411,7 +418,7 @@ void test_checkout_conflict__links(void)
void test_checkout_conflict__add_add(void)
{
- git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT;
+ git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT;
struct checkout_index_entry checkout_index_entries[] = {
{ 0100644, CONFLICTING_OURS_OID, 2, "conflicting.txt" },
@@ -431,7 +438,7 @@ void test_checkout_conflict__add_add(void)
void test_checkout_conflict__mode_change(void)
{
- git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT;
+ git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT;
struct checkout_index_entry checkout_index_entries[] = {
{ 0100644, CONFLICTING_ANCESTOR_OID, 1, "executable-1" },
@@ -488,7 +495,7 @@ void test_checkout_conflict__mode_change(void)
void test_checkout_conflict__renames(void)
{
- git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT;
+ git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT;
struct checkout_index_entry checkout_index_entries[] = {
{ 0100644, "68c6c84b091926c7d90aa6a79b2bc3bb6adccd8e", 0, "0a-no-change.txt" },
@@ -673,7 +680,7 @@ void test_checkout_conflict__renames(void)
void test_checkout_conflict__rename_keep_ours(void)
{
- git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT;
+ git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT;
struct checkout_index_entry checkout_index_entries[] = {
{ 0100644, "68c6c84b091926c7d90aa6a79b2bc3bb6adccd8e", 0, "0a-no-change.txt" },
@@ -840,7 +847,7 @@ void test_checkout_conflict__rename_keep_ours(void)
void test_checkout_conflict__name_mangled_file_exists_in_workdir(void)
{
- git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT;
+ git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT;
struct checkout_index_entry checkout_index_entries[] = {
{ 0100644, "b42712cfe99a1a500b2a51fe984e0b8a7702ba11", 1, "test-one-side-one.txt" },
@@ -980,7 +987,7 @@ void test_checkout_conflict__name_mangled_file_exists_in_workdir(void)
void test_checkout_conflict__update_only(void)
{
- git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT;
+ git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT;
struct checkout_index_entry checkout_index_entries[] = {
{ 0100644, AUTOMERGEABLE_ANCESTOR_OID, 1, "automergeable.txt" },
@@ -1025,7 +1032,7 @@ void test_checkout_conflict__update_only(void)
void test_checkout_conflict__path_filters(void)
{
- git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT;
+ git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT;
char *paths[] = { "conflicting-1.txt", "conflicting-3.txt" };
git_strarray patharray = {0};
@@ -1082,7 +1089,7 @@ static void collect_progress(
void test_checkout_conflict__report_progress(void)
{
- git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT;
+ git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT;
git_vector paths = GIT_VECTOR_INIT;
char *path;
size_t i;