Commit f62c174d by Russell Belfer

GIT_DIFF_FIND_REMOVE_UNMODIFIED sounds better

parent 97ad85b8
......@@ -525,14 +525,14 @@ typedef enum {
*/
GIT_DIFF_BREAK_REWRITES_FOR_RENAMES_ONLY = (1u << 15),
/** Delete any UNMODIFIED records after find_similar is done.
/** Remove any UNMODIFIED deltas after find_similar is done.
*
* Using GIT_DIFF_FIND_COPIES_FROM_UNMODIFIED to emulate the
* --find-copies-harder behavior requires building a diff with the
* GIT_DIFF_INCLUDE_UNMODIFIED flag. If you do not want UNMODIFIED
* records in the final result, pass this flag to have them removed.
*/
GIT_DIFF_FIND_DELETE_UNMODIFIED = (1u << 16),
GIT_DIFF_FIND_REMOVE_UNMODIFIED = (1u << 16),
} git_diff_find_t;
/**
......
......@@ -746,7 +746,7 @@ static bool is_rename_source(
case GIT_DELTA_UNMODIFIED:
if (!FLAG_SET(opts, GIT_DIFF_FIND_COPIES_FROM_UNMODIFIED))
return false;
if (FLAG_SET(opts, GIT_DIFF_FIND_DELETE_UNMODIFIED))
if (FLAG_SET(opts, GIT_DIFF_FIND_REMOVE_UNMODIFIED))
delta->flags |= GIT_DIFF_FLAG__TO_DELETE;
break;
......
......@@ -1365,7 +1365,7 @@ void test_diff_rename__can_delete_unmodified_deltas(void)
cl_assert_equal_i(1, exp.file_status[GIT_DELTA_MODIFIED]);
cl_assert_equal_i(3, exp.file_status[GIT_DELTA_UNMODIFIED]);
opts.flags = GIT_DIFF_FIND_ALL | GIT_DIFF_FIND_DELETE_UNMODIFIED;
opts.flags = GIT_DIFF_FIND_ALL | GIT_DIFF_FIND_REMOVE_UNMODIFIED;
cl_git_pass(git_diff_find_similar(diff, &opts));
memset(&exp, 0, sizeof(exp));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment