summaryrefslogtreecommitdiff
path: root/tests-clar/diff/rename.c
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-06-18 16:14:35 -0700
committerRussell Belfer <rb@github.com>2013-06-18 16:14:35 -0700
commite4acc3ba19838d39123131d4cc7e52f222691445 (patch)
treefb844930bf59730c32eeba739b97efe85df0b50c /tests-clar/diff/rename.c
parent3b334075c909f9023f5f704469965cf774efc4a5 (diff)
downloadlibgit2-e4acc3ba19838d39123131d4cc7e52f222691445.tar.gz
Fix rename looped reference issues
This makes the diff rename tracking code more careful about the order in which it processes renames and more thorough in updating the mapping of correct renames when an earlier rename update alters the index of a later matched pair.
Diffstat (limited to 'tests-clar/diff/rename.c')
-rw-r--r--tests-clar/diff/rename.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/tests-clar/diff/rename.c b/tests-clar/diff/rename.c
index e6bf72c17..79f407057 100644
--- a/tests-clar/diff/rename.c
+++ b/tests-clar/diff/rename.c
@@ -755,7 +755,7 @@ void test_diff_rename__file_partial_exchange(void)
git_buf_free(&c2);
}
-void test_diff_rename__file_split(void)
+void test_diff_rename__rename_and_copy_from_same_source(void)
{
git_buf c1 = GIT_BUF_INIT, c2 = GIT_BUF_INIT;
git_index *index;
@@ -947,6 +947,7 @@ void test_diff_rename__rejected_match_can_match_others(void)
cl_git_pass(
git_diff_tree_to_index(&diff, g_repo, tree, index, &diffopts));
+
cl_git_pass(git_diff_find_similar(diff, &findopts));
cl_git_pass(
@@ -967,10 +968,10 @@ static void write_similarity_file_two(const char *filename, size_t b_lines)
size_t i;
for (i = 0; i < b_lines; i++)
- git_buf_printf(&contents, "%0.2d - bbbbb\r\n", (i+1));
+ git_buf_printf(&contents, "%0.2d - bbbbb\r\n", (int)(i+1));
for (i = b_lines; i < 50; i++)
- git_buf_printf(&contents, "%0.2d - aaaaa%s", (i+1), (i == 49 ? "" : "\r\n"));
+ git_buf_printf(&contents, "%0.2d - aaaaa%s", (int)(i+1), (i == 49 ? "" : "\r\n"));
cl_git_pass(
git_futils_writebuffer(&contents, filename, O_RDWR|O_CREAT, 0777));
@@ -1018,6 +1019,7 @@ void test_diff_rename__rejected_match_can_match_others_two(void)
cl_git_pass(
git_diff_tree_to_index(&diff, g_repo, tree, index, &diffopts));
+
cl_git_pass(git_diff_find_similar(diff, &findopts));
cl_git_pass(