mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-18 18:30:29 +00:00
checkout rename conflicts
rename conflict tests for checkout conflicts, don't suffix filenames when checking out with USE_OURS or USE_THEIRS
This commit is contained in:
parent
4f7897ab19
commit
96d799aa18
@ -395,7 +395,10 @@ static int checkout_write_entry(
|
||||
if (git_buf_puts(&data->path, side->path) < 0)
|
||||
return -1;
|
||||
|
||||
if (conflict->name_collision || conflict->directoryfile) {
|
||||
if ((conflict->name_collision || conflict->directoryfile) &&
|
||||
(data->strategy & GIT_CHECKOUT_USE_OURS) == 0 &&
|
||||
(data->strategy & GIT_CHECKOUT_USE_THEIRS) == 0) {
|
||||
|
||||
if (side == conflict->ours)
|
||||
side_label = data->opts.our_label ? data->opts.our_label :
|
||||
"ours";
|
||||
|
@ -53,6 +53,12 @@ struct checkout_index_entry {
|
||||
char path[128];
|
||||
};
|
||||
|
||||
struct checkout_name_entry {
|
||||
char ancestor[64];
|
||||
char ours[64];
|
||||
char theirs[64];
|
||||
};
|
||||
|
||||
void test_checkout_conflict__initialize(void)
|
||||
{
|
||||
g_repo = cl_git_sandbox_init(TEST_REPO_PATH);
|
||||
@ -91,12 +97,24 @@ static void create_index(struct checkout_index_entry *entries, size_t entries_le
|
||||
git_oid_fromstr(&entry.oid, entries[i].oid_str);
|
||||
entry.path = entries[i].path;
|
||||
|
||||
git_index_add(g_index, &entry);
|
||||
cl_git_pass(git_index_add(g_index, &entry));
|
||||
}
|
||||
|
||||
git_buf_free(&path);
|
||||
}
|
||||
|
||||
static void create_index_names(struct checkout_name_entry *entries, size_t entries_len)
|
||||
{
|
||||
size_t i;
|
||||
|
||||
for (i = 0; i < entries_len; i++) {
|
||||
cl_git_pass(git_index_name_add(g_index,
|
||||
strlen(entries[i].ancestor) == 0 ? NULL : entries[i].ancestor,
|
||||
strlen(entries[i].ours) == 0 ? NULL : entries[i].ours,
|
||||
strlen(entries[i].theirs) == 0 ? NULL : entries[i].theirs));
|
||||
}
|
||||
}
|
||||
|
||||
static void create_conflicting_index(void)
|
||||
{
|
||||
struct checkout_index_entry checkout_index_entries[] = {
|
||||
@ -148,6 +166,12 @@ static void ensure_workdir_mode(const char *path, int mode)
|
||||
#endif
|
||||
}
|
||||
|
||||
static void ensure_workdir(const char *path, int mode, const char *oid_str)
|
||||
{
|
||||
ensure_workdir_mode(path, mode);
|
||||
ensure_workdir_oid(path, oid_str);
|
||||
}
|
||||
|
||||
static void ensure_workdir_link(const char *path, const char *target)
|
||||
{
|
||||
#ifdef GIT_WIN32
|
||||
@ -458,3 +482,355 @@ void test_checkout_conflict__mode_change(void)
|
||||
ensure_workdir_contents("executable-6", CONFLICTING_DIFF3_FILE);
|
||||
ensure_workdir_mode("executable-6", 0100644);
|
||||
}
|
||||
|
||||
void test_checkout_conflict__renames(void)
|
||||
{
|
||||
git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT;
|
||||
|
||||
struct checkout_index_entry checkout_index_entries[] = {
|
||||
{ 0100644, "68c6c84b091926c7d90aa6a79b2bc3bb6adccd8e", 0, "0a-no-change.txt" },
|
||||
{ 0100644, "f0ce2b8e4986084d9b308fb72709e414c23eb5e6", 0, "0b-duplicated-in-ours.txt" },
|
||||
{ 0100644, "f0ce2b8e4986084d9b308fb72709e414c23eb5e6", 1, "0b-rewritten-in-ours.txt" },
|
||||
{ 0100644, "e376fbdd06ebf021c92724da9f26f44212734e3e", 2, "0b-rewritten-in-ours.txt" },
|
||||
{ 0100644, "b2d399ae15224e1d58066e3c8df70ce37de7a656", 3, "0b-rewritten-in-ours.txt" },
|
||||
{ 0100644, "2f56120107d680129a5d9791b521cb1e73a2ed31", 0, "0c-duplicated-in-theirs.txt" },
|
||||
{ 0100644, "2f56120107d680129a5d9791b521cb1e73a2ed31", 1, "0c-rewritten-in-theirs.txt" },
|
||||
{ 0100644, "efc9121fdedaf08ba180b53ebfbcf71bd488ed09", 2, "0c-rewritten-in-theirs.txt" },
|
||||
{ 0100644, "712ebba6669ea847d9829e4f1059d6c830c8b531", 3, "0c-rewritten-in-theirs.txt" },
|
||||
{ 0100644, "0d872f8e871a30208305978ecbf9e66d864f1638", 0, "1a-newname-in-ours-edited-in-theirs.txt" },
|
||||
{ 0100644, "d0d4594e16f2e19107e3fa7ea63e7aaaff305ffb", 0, "1a-newname-in-ours.txt" },
|
||||
{ 0100644, "ed9523e62e453e50dd9be1606af19399b96e397a", 0, "1b-newname-in-theirs-edited-in-ours.txt" },
|
||||
{ 0100644, "2b5f1f181ee3b58ea751f5dd5d8f9b445520a136", 0, "1b-newname-in-theirs.txt" },
|
||||
{ 0100644, "178940b450f238a56c0d75b7955cb57b38191982", 0, "2-newname-in-both.txt" },
|
||||
{ 0100644, "18cb316b1cefa0f8a6946f0e201a8e1a6f845ab9", 2, "3a-newname-in-ours-deleted-in-theirs.txt" },
|
||||
{ 0100644, "18cb316b1cefa0f8a6946f0e201a8e1a6f845ab9", 1, "3a-renamed-in-ours-deleted-in-theirs.txt" },
|
||||
{ 0100644, "36219b49367146cb2e6a1555b5a9ebd4d0328495", 3, "3b-newname-in-theirs-deleted-in-ours.txt" },
|
||||
{ 0100644, "36219b49367146cb2e6a1555b5a9ebd4d0328495", 1, "3b-renamed-in-theirs-deleted-in-ours.txt" },
|
||||
{ 0100644, "227792b52aaa0b238bea00ec7e509b02623f168c", 2, "4a-newname-in-ours-added-in-theirs.txt" },
|
||||
{ 0100644, "8b5b53cb2aa9ceb1139f5312fcfa3cc3c5a47c9a", 3, "4a-newname-in-ours-added-in-theirs.txt" },
|
||||
{ 0100644, "227792b52aaa0b238bea00ec7e509b02623f168c", 1, "4a-renamed-in-ours-added-in-theirs.txt" },
|
||||
{ 0100644, "de872ee3618b894992e9d1e18ba2ebe256a112f9", 2, "4b-newname-in-theirs-added-in-ours.txt" },
|
||||
{ 0100644, "98d52d07c0b0bbf2b46548f6aa521295c2cb55db", 3, "4b-newname-in-theirs-added-in-ours.txt" },
|
||||
{ 0100644, "98d52d07c0b0bbf2b46548f6aa521295c2cb55db", 1, "4b-renamed-in-theirs-added-in-ours.txt" },
|
||||
{ 0100644, "d3719a5ae8e4d92276b5313ce976f6ee5af2b436", 2, "5a-newname-in-ours-added-in-theirs.txt" },
|
||||
{ 0100644, "98ba4205fcf31f5dd93c916d35fe3f3b3d0e6714", 3, "5a-newname-in-ours-added-in-theirs.txt" },
|
||||
{ 0100644, "d3719a5ae8e4d92276b5313ce976f6ee5af2b436", 1, "5a-renamed-in-ours-added-in-theirs.txt" },
|
||||
{ 0100644, "d3719a5ae8e4d92276b5313ce976f6ee5af2b436", 3, "5a-renamed-in-ours-added-in-theirs.txt" },
|
||||
{ 0100644, "385c8a0f26ddf79e9041e15e17dc352ed2c4cced", 2, "5b-newname-in-theirs-added-in-ours.txt" },
|
||||
{ 0100644, "63247125386de9ec90a27ad36169307bf8a11a38", 3, "5b-newname-in-theirs-added-in-ours.txt" },
|
||||
{ 0100644, "63247125386de9ec90a27ad36169307bf8a11a38", 1, "5b-renamed-in-theirs-added-in-ours.txt" },
|
||||
{ 0100644, "63247125386de9ec90a27ad36169307bf8a11a38", 2, "5b-renamed-in-theirs-added-in-ours.txt" },
|
||||
{ 0100644, "d8fa77b6833082c1ea36b7828a582d4c43882450", 2, "6-both-renamed-1-to-2-ours.txt" },
|
||||
{ 0100644, "d8fa77b6833082c1ea36b7828a582d4c43882450", 3, "6-both-renamed-1-to-2-theirs.txt" },
|
||||
{ 0100644, "d8fa77b6833082c1ea36b7828a582d4c43882450", 1, "6-both-renamed-1-to-2.txt" },
|
||||
{ 0100644, "b42712cfe99a1a500b2a51fe984e0b8a7702ba11", 1, "7-both-renamed-side-1.txt" },
|
||||
{ 0100644, "b42712cfe99a1a500b2a51fe984e0b8a7702ba11", 3, "7-both-renamed-side-1.txt" },
|
||||
{ 0100644, "b69fe837e4cecfd4c9a40cdca7c138468687df07", 1, "7-both-renamed-side-2.txt" },
|
||||
{ 0100644, "b69fe837e4cecfd4c9a40cdca7c138468687df07", 2, "7-both-renamed-side-2.txt" },
|
||||
{ 0100644, "b42712cfe99a1a500b2a51fe984e0b8a7702ba11", 2, "7-both-renamed.txt" },
|
||||
{ 0100644, "b69fe837e4cecfd4c9a40cdca7c138468687df07", 3, "7-both-renamed.txt" }
|
||||
};
|
||||
|
||||
struct checkout_name_entry checkout_name_entries[] = {
|
||||
{
|
||||
"3a-renamed-in-ours-deleted-in-theirs.txt",
|
||||
"3a-newname-in-ours-deleted-in-theirs.txt",
|
||||
""
|
||||
},
|
||||
|
||||
{
|
||||
"3b-renamed-in-theirs-deleted-in-ours.txt",
|
||||
"",
|
||||
"3b-newname-in-theirs-deleted-in-ours.txt"
|
||||
},
|
||||
|
||||
{
|
||||
"4a-renamed-in-ours-added-in-theirs.txt",
|
||||
"4a-newname-in-ours-added-in-theirs.txt",
|
||||
""
|
||||
},
|
||||
|
||||
{
|
||||
"4b-renamed-in-theirs-added-in-ours.txt",
|
||||
"",
|
||||
"4b-newname-in-theirs-added-in-ours.txt"
|
||||
},
|
||||
|
||||
{
|
||||
"5a-renamed-in-ours-added-in-theirs.txt",
|
||||
"5a-newname-in-ours-added-in-theirs.txt",
|
||||
"5a-renamed-in-ours-added-in-theirs.txt"
|
||||
},
|
||||
|
||||
{
|
||||
"5b-renamed-in-theirs-added-in-ours.txt",
|
||||
"5b-renamed-in-theirs-added-in-ours.txt",
|
||||
"5b-newname-in-theirs-added-in-ours.txt"
|
||||
},
|
||||
|
||||
{
|
||||
"6-both-renamed-1-to-2.txt",
|
||||
"6-both-renamed-1-to-2-ours.txt",
|
||||
"6-both-renamed-1-to-2-theirs.txt"
|
||||
},
|
||||
|
||||
{
|
||||
"7-both-renamed-side-1.txt",
|
||||
"7-both-renamed.txt",
|
||||
"7-both-renamed-side-1.txt"
|
||||
},
|
||||
|
||||
{
|
||||
"7-both-renamed-side-2.txt",
|
||||
"7-both-renamed-side-2.txt",
|
||||
"7-both-renamed.txt"
|
||||
}
|
||||
};
|
||||
|
||||
opts.checkout_strategy |= GIT_CHECKOUT_SAFE;
|
||||
|
||||
create_index(checkout_index_entries, 41);
|
||||
create_index_names(checkout_name_entries, 9);
|
||||
git_index_write(g_index);
|
||||
|
||||
cl_git_pass(git_checkout_index(g_repo, g_index, &opts));
|
||||
|
||||
ensure_workdir("0a-no-change.txt",
|
||||
0100644, "68c6c84b091926c7d90aa6a79b2bc3bb6adccd8e");
|
||||
|
||||
ensure_workdir("0b-duplicated-in-ours.txt",
|
||||
0100644, "f0ce2b8e4986084d9b308fb72709e414c23eb5e6");
|
||||
|
||||
ensure_workdir("0b-rewritten-in-ours.txt",
|
||||
0100644, "4c7e515d6d52d820496858f2f059ece69e99e2e3");
|
||||
|
||||
ensure_workdir("0c-duplicated-in-theirs.txt",
|
||||
0100644, "2f56120107d680129a5d9791b521cb1e73a2ed31");
|
||||
|
||||
ensure_workdir("0c-rewritten-in-theirs.txt",
|
||||
0100644, "4648d658682d1155c2a3db5b0c53305e26884ea5");
|
||||
|
||||
ensure_workdir("1a-newname-in-ours-edited-in-theirs.txt",
|
||||
0100644, "0d872f8e871a30208305978ecbf9e66d864f1638");
|
||||
|
||||
ensure_workdir("1a-newname-in-ours.txt",
|
||||
0100644, "d0d4594e16f2e19107e3fa7ea63e7aaaff305ffb");
|
||||
|
||||
ensure_workdir("1b-newname-in-theirs-edited-in-ours.txt",
|
||||
0100644, "ed9523e62e453e50dd9be1606af19399b96e397a");
|
||||
|
||||
ensure_workdir("1b-newname-in-theirs.txt",
|
||||
0100644, "2b5f1f181ee3b58ea751f5dd5d8f9b445520a136");
|
||||
|
||||
ensure_workdir("2-newname-in-both.txt",
|
||||
0100644, "178940b450f238a56c0d75b7955cb57b38191982");
|
||||
|
||||
ensure_workdir("3a-newname-in-ours-deleted-in-theirs.txt",
|
||||
0100644, "18cb316b1cefa0f8a6946f0e201a8e1a6f845ab9");
|
||||
|
||||
ensure_workdir("3b-newname-in-theirs-deleted-in-ours.txt",
|
||||
0100644, "36219b49367146cb2e6a1555b5a9ebd4d0328495");
|
||||
|
||||
ensure_workdir("4a-newname-in-ours-added-in-theirs.txt~ours",
|
||||
0100644, "227792b52aaa0b238bea00ec7e509b02623f168c");
|
||||
|
||||
ensure_workdir("4a-newname-in-ours-added-in-theirs.txt~theirs",
|
||||
0100644, "8b5b53cb2aa9ceb1139f5312fcfa3cc3c5a47c9a");
|
||||
|
||||
ensure_workdir("4b-newname-in-theirs-added-in-ours.txt~ours",
|
||||
0100644, "de872ee3618b894992e9d1e18ba2ebe256a112f9");
|
||||
|
||||
ensure_workdir("4b-newname-in-theirs-added-in-ours.txt~theirs",
|
||||
0100644, "98d52d07c0b0bbf2b46548f6aa521295c2cb55db");
|
||||
|
||||
ensure_workdir("5a-newname-in-ours-added-in-theirs.txt~ours",
|
||||
0100644, "d3719a5ae8e4d92276b5313ce976f6ee5af2b436");
|
||||
|
||||
ensure_workdir("5a-newname-in-ours-added-in-theirs.txt~theirs",
|
||||
0100644, "98ba4205fcf31f5dd93c916d35fe3f3b3d0e6714");
|
||||
|
||||
ensure_workdir("5b-newname-in-theirs-added-in-ours.txt~ours",
|
||||
0100644, "385c8a0f26ddf79e9041e15e17dc352ed2c4cced");
|
||||
|
||||
ensure_workdir("5b-newname-in-theirs-added-in-ours.txt~theirs",
|
||||
0100644, "63247125386de9ec90a27ad36169307bf8a11a38");
|
||||
|
||||
ensure_workdir("6-both-renamed-1-to-2-ours.txt",
|
||||
0100644, "d8fa77b6833082c1ea36b7828a582d4c43882450");
|
||||
|
||||
ensure_workdir("6-both-renamed-1-to-2-theirs.txt",
|
||||
0100644, "d8fa77b6833082c1ea36b7828a582d4c43882450");
|
||||
|
||||
ensure_workdir("7-both-renamed.txt~ours",
|
||||
0100644, "b42712cfe99a1a500b2a51fe984e0b8a7702ba11");
|
||||
|
||||
ensure_workdir("7-both-renamed.txt~theirs",
|
||||
0100644, "b69fe837e4cecfd4c9a40cdca7c138468687df07");
|
||||
}
|
||||
|
||||
void test_checkout_conflict__rename_keep_ours(void)
|
||||
{
|
||||
git_checkout_opts opts = GIT_CHECKOUT_OPTS_INIT;
|
||||
|
||||
struct checkout_index_entry checkout_index_entries[] = {
|
||||
{ 0100644, "68c6c84b091926c7d90aa6a79b2bc3bb6adccd8e", 0, "0a-no-change.txt" },
|
||||
{ 0100644, "f0ce2b8e4986084d9b308fb72709e414c23eb5e6", 0, "0b-duplicated-in-ours.txt" },
|
||||
{ 0100644, "f0ce2b8e4986084d9b308fb72709e414c23eb5e6", 1, "0b-rewritten-in-ours.txt" },
|
||||
{ 0100644, "e376fbdd06ebf021c92724da9f26f44212734e3e", 2, "0b-rewritten-in-ours.txt" },
|
||||
{ 0100644, "b2d399ae15224e1d58066e3c8df70ce37de7a656", 3, "0b-rewritten-in-ours.txt" },
|
||||
{ 0100644, "2f56120107d680129a5d9791b521cb1e73a2ed31", 0, "0c-duplicated-in-theirs.txt" },
|
||||
{ 0100644, "2f56120107d680129a5d9791b521cb1e73a2ed31", 1, "0c-rewritten-in-theirs.txt" },
|
||||
{ 0100644, "efc9121fdedaf08ba180b53ebfbcf71bd488ed09", 2, "0c-rewritten-in-theirs.txt" },
|
||||
{ 0100644, "712ebba6669ea847d9829e4f1059d6c830c8b531", 3, "0c-rewritten-in-theirs.txt" },
|
||||
{ 0100644, "0d872f8e871a30208305978ecbf9e66d864f1638", 0, "1a-newname-in-ours-edited-in-theirs.txt" },
|
||||
{ 0100644, "d0d4594e16f2e19107e3fa7ea63e7aaaff305ffb", 0, "1a-newname-in-ours.txt" },
|
||||
{ 0100644, "ed9523e62e453e50dd9be1606af19399b96e397a", 0, "1b-newname-in-theirs-edited-in-ours.txt" },
|
||||
{ 0100644, "2b5f1f181ee3b58ea751f5dd5d8f9b445520a136", 0, "1b-newname-in-theirs.txt" },
|
||||
{ 0100644, "178940b450f238a56c0d75b7955cb57b38191982", 0, "2-newname-in-both.txt" },
|
||||
{ 0100644, "18cb316b1cefa0f8a6946f0e201a8e1a6f845ab9", 2, "3a-newname-in-ours-deleted-in-theirs.txt" },
|
||||
{ 0100644, "18cb316b1cefa0f8a6946f0e201a8e1a6f845ab9", 1, "3a-renamed-in-ours-deleted-in-theirs.txt" },
|
||||
{ 0100644, "36219b49367146cb2e6a1555b5a9ebd4d0328495", 3, "3b-newname-in-theirs-deleted-in-ours.txt" },
|
||||
{ 0100644, "36219b49367146cb2e6a1555b5a9ebd4d0328495", 1, "3b-renamed-in-theirs-deleted-in-ours.txt" },
|
||||
{ 0100644, "227792b52aaa0b238bea00ec7e509b02623f168c", 2, "4a-newname-in-ours-added-in-theirs.txt" },
|
||||
{ 0100644, "8b5b53cb2aa9ceb1139f5312fcfa3cc3c5a47c9a", 3, "4a-newname-in-ours-added-in-theirs.txt" },
|
||||
{ 0100644, "227792b52aaa0b238bea00ec7e509b02623f168c", 1, "4a-renamed-in-ours-added-in-theirs.txt" },
|
||||
{ 0100644, "de872ee3618b894992e9d1e18ba2ebe256a112f9", 2, "4b-newname-in-theirs-added-in-ours.txt" },
|
||||
{ 0100644, "98d52d07c0b0bbf2b46548f6aa521295c2cb55db", 3, "4b-newname-in-theirs-added-in-ours.txt" },
|
||||
{ 0100644, "98d52d07c0b0bbf2b46548f6aa521295c2cb55db", 1, "4b-renamed-in-theirs-added-in-ours.txt" },
|
||||
{ 0100644, "d3719a5ae8e4d92276b5313ce976f6ee5af2b436", 2, "5a-newname-in-ours-added-in-theirs.txt" },
|
||||
{ 0100644, "98ba4205fcf31f5dd93c916d35fe3f3b3d0e6714", 3, "5a-newname-in-ours-added-in-theirs.txt" },
|
||||
{ 0100644, "d3719a5ae8e4d92276b5313ce976f6ee5af2b436", 1, "5a-renamed-in-ours-added-in-theirs.txt" },
|
||||
{ 0100644, "d3719a5ae8e4d92276b5313ce976f6ee5af2b436", 3, "5a-renamed-in-ours-added-in-theirs.txt" },
|
||||
{ 0100644, "385c8a0f26ddf79e9041e15e17dc352ed2c4cced", 2, "5b-newname-in-theirs-added-in-ours.txt" },
|
||||
{ 0100644, "63247125386de9ec90a27ad36169307bf8a11a38", 3, "5b-newname-in-theirs-added-in-ours.txt" },
|
||||
{ 0100644, "63247125386de9ec90a27ad36169307bf8a11a38", 1, "5b-renamed-in-theirs-added-in-ours.txt" },
|
||||
{ 0100644, "63247125386de9ec90a27ad36169307bf8a11a38", 2, "5b-renamed-in-theirs-added-in-ours.txt" },
|
||||
{ 0100644, "d8fa77b6833082c1ea36b7828a582d4c43882450", 2, "6-both-renamed-1-to-2-ours.txt" },
|
||||
{ 0100644, "d8fa77b6833082c1ea36b7828a582d4c43882450", 3, "6-both-renamed-1-to-2-theirs.txt" },
|
||||
{ 0100644, "d8fa77b6833082c1ea36b7828a582d4c43882450", 1, "6-both-renamed-1-to-2.txt" },
|
||||
{ 0100644, "b42712cfe99a1a500b2a51fe984e0b8a7702ba11", 1, "7-both-renamed-side-1.txt" },
|
||||
{ 0100644, "b42712cfe99a1a500b2a51fe984e0b8a7702ba11", 3, "7-both-renamed-side-1.txt" },
|
||||
{ 0100644, "b69fe837e4cecfd4c9a40cdca7c138468687df07", 1, "7-both-renamed-side-2.txt" },
|
||||
{ 0100644, "b69fe837e4cecfd4c9a40cdca7c138468687df07", 2, "7-both-renamed-side-2.txt" },
|
||||
{ 0100644, "b42712cfe99a1a500b2a51fe984e0b8a7702ba11", 2, "7-both-renamed.txt" },
|
||||
{ 0100644, "b69fe837e4cecfd4c9a40cdca7c138468687df07", 3, "7-both-renamed.txt" }
|
||||
};
|
||||
|
||||
struct checkout_name_entry checkout_name_entries[] = {
|
||||
{
|
||||
"3a-renamed-in-ours-deleted-in-theirs.txt",
|
||||
"3a-newname-in-ours-deleted-in-theirs.txt",
|
||||
""
|
||||
},
|
||||
|
||||
{
|
||||
"3b-renamed-in-theirs-deleted-in-ours.txt",
|
||||
"",
|
||||
"3b-newname-in-theirs-deleted-in-ours.txt"
|
||||
},
|
||||
|
||||
{
|
||||
"4a-renamed-in-ours-added-in-theirs.txt",
|
||||
"4a-newname-in-ours-added-in-theirs.txt",
|
||||
""
|
||||
},
|
||||
|
||||
{
|
||||
"4b-renamed-in-theirs-added-in-ours.txt",
|
||||
"",
|
||||
"4b-newname-in-theirs-added-in-ours.txt"
|
||||
},
|
||||
|
||||
{
|
||||
"5a-renamed-in-ours-added-in-theirs.txt",
|
||||
"5a-newname-in-ours-added-in-theirs.txt",
|
||||
"5a-renamed-in-ours-added-in-theirs.txt"
|
||||
},
|
||||
|
||||
{
|
||||
"5b-renamed-in-theirs-added-in-ours.txt",
|
||||
"5b-renamed-in-theirs-added-in-ours.txt",
|
||||
"5b-newname-in-theirs-added-in-ours.txt"
|
||||
},
|
||||
|
||||
{
|
||||
"6-both-renamed-1-to-2.txt",
|
||||
"6-both-renamed-1-to-2-ours.txt",
|
||||
"6-both-renamed-1-to-2-theirs.txt"
|
||||
},
|
||||
|
||||
{
|
||||
"7-both-renamed-side-1.txt",
|
||||
"7-both-renamed.txt",
|
||||
"7-both-renamed-side-1.txt"
|
||||
},
|
||||
|
||||
{
|
||||
"7-both-renamed-side-2.txt",
|
||||
"7-both-renamed-side-2.txt",
|
||||
"7-both-renamed.txt"
|
||||
}
|
||||
};
|
||||
|
||||
opts.checkout_strategy |= GIT_CHECKOUT_SAFE | GIT_CHECKOUT_USE_OURS;
|
||||
|
||||
create_index(checkout_index_entries, 41);
|
||||
create_index_names(checkout_name_entries, 9);
|
||||
git_index_write(g_index);
|
||||
|
||||
cl_git_pass(git_checkout_index(g_repo, g_index, &opts));
|
||||
|
||||
ensure_workdir("0a-no-change.txt",
|
||||
0100644, "68c6c84b091926c7d90aa6a79b2bc3bb6adccd8e");
|
||||
|
||||
ensure_workdir("0b-duplicated-in-ours.txt",
|
||||
0100644, "f0ce2b8e4986084d9b308fb72709e414c23eb5e6");
|
||||
|
||||
ensure_workdir("0b-rewritten-in-ours.txt",
|
||||
0100644, "e376fbdd06ebf021c92724da9f26f44212734e3e");
|
||||
|
||||
ensure_workdir("0c-duplicated-in-theirs.txt",
|
||||
0100644, "2f56120107d680129a5d9791b521cb1e73a2ed31");
|
||||
|
||||
ensure_workdir("0c-rewritten-in-theirs.txt",
|
||||
0100644, "efc9121fdedaf08ba180b53ebfbcf71bd488ed09");
|
||||
|
||||
ensure_workdir("1a-newname-in-ours-edited-in-theirs.txt",
|
||||
0100644, "0d872f8e871a30208305978ecbf9e66d864f1638");
|
||||
|
||||
ensure_workdir("1a-newname-in-ours.txt",
|
||||
0100644, "d0d4594e16f2e19107e3fa7ea63e7aaaff305ffb");
|
||||
|
||||
ensure_workdir("1b-newname-in-theirs-edited-in-ours.txt",
|
||||
0100644, "ed9523e62e453e50dd9be1606af19399b96e397a");
|
||||
|
||||
ensure_workdir("1b-newname-in-theirs.txt",
|
||||
0100644, "2b5f1f181ee3b58ea751f5dd5d8f9b445520a136");
|
||||
|
||||
ensure_workdir("2-newname-in-both.txt",
|
||||
0100644, "178940b450f238a56c0d75b7955cb57b38191982");
|
||||
|
||||
ensure_workdir("3a-newname-in-ours-deleted-in-theirs.txt",
|
||||
0100644, "18cb316b1cefa0f8a6946f0e201a8e1a6f845ab9");
|
||||
|
||||
ensure_workdir("3b-newname-in-theirs-deleted-in-ours.txt",
|
||||
0100644, "36219b49367146cb2e6a1555b5a9ebd4d0328495");
|
||||
|
||||
ensure_workdir("4a-newname-in-ours-added-in-theirs.txt",
|
||||
0100644, "227792b52aaa0b238bea00ec7e509b02623f168c");
|
||||
|
||||
ensure_workdir("4b-newname-in-theirs-added-in-ours.txt",
|
||||
0100644, "de872ee3618b894992e9d1e18ba2ebe256a112f9");
|
||||
|
||||
ensure_workdir("5a-newname-in-ours-added-in-theirs.txt",
|
||||
0100644, "d3719a5ae8e4d92276b5313ce976f6ee5af2b436");
|
||||
|
||||
ensure_workdir("5b-newname-in-theirs-added-in-ours.txt",
|
||||
0100644, "385c8a0f26ddf79e9041e15e17dc352ed2c4cced");
|
||||
|
||||
ensure_workdir("6-both-renamed-1-to-2-ours.txt",
|
||||
0100644, "d8fa77b6833082c1ea36b7828a582d4c43882450");
|
||||
|
||||
ensure_workdir("7-both-renamed.txt",
|
||||
0100644, "b42712cfe99a1a500b2a51fe984e0b8a7702ba11");
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user