diff options
| author | Edward Thomson <ethomson@edwardthomson.com> | 2013-01-12 13:47:56 -0600 |
|---|---|---|
| committer | Edward Thomson <ethomson@edwardthomson.com> | 2013-01-12 13:47:56 -0600 |
| commit | 25743bd7c5f14f2287d9c4fdf953c978e3b16916 (patch) | |
| tree | 7390d1d2d5d52f549329853903f381e58c1b1de6 /tests-clar/index/conflicts.c | |
| parent | e2d2c6e57d122f381fb42b7df1c7a12819050490 (diff) | |
| download | libgit2-25743bd7c5f14f2287d9c4fdf953c978e3b16916.tar.gz | |
add an index_remove_bypath that removes conflicts, renamed add_from_workdir to match
Diffstat (limited to 'tests-clar/index/conflicts.c')
| -rw-r--r-- | tests-clar/index/conflicts.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/tests-clar/index/conflicts.c b/tests-clar/index/conflicts.c index 2fbad3e67..4b8a0cffd 100644 --- a/tests-clar/index/conflicts.c +++ b/tests-clar/index/conflicts.c @@ -154,7 +154,7 @@ void test_index_conflicts__remove(void) } } -void test_index_conflicts__moved_to_reuc(void) +void test_index_conflicts__moved_to_reuc_on_add(void) { const git_index_entry *entry; size_t i; @@ -163,7 +163,7 @@ void test_index_conflicts__moved_to_reuc(void) cl_git_mkfile("./mergedrepo/conflicts-one.txt", "new-file\n"); - cl_git_pass(git_index_add_from_workdir(repo_index, "conflicts-one.txt")); + cl_git_pass(git_index_add_bypath(repo_index, "conflicts-one.txt")); cl_assert(git_index_entrycount(repo_index) == 6); @@ -175,6 +175,25 @@ void test_index_conflicts__moved_to_reuc(void) } } +void test_index_conflicts__moved_to_reuc_on_remove(void) +{ + const git_index_entry *entry; + size_t i; + + cl_assert(git_index_entrycount(repo_index) == 8); + + cl_git_pass(p_unlink("./mergedrepo/conflicts-one.txt")); + + cl_git_pass(git_index_remove_bypath(repo_index, "conflicts-one.txt")); + + cl_assert(git_index_entrycount(repo_index) == 5); + + for (i = 0; i < git_index_entrycount(repo_index); i++) { + cl_assert(entry = git_index_get_byindex(repo_index, i)); + cl_assert(strcmp(entry->path, "conflicts-one.txt") != 0); + } +} + void test_index_conflicts__remove_all_conflicts(void) { size_t i; |
