mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-30 08:12:42 +00:00
GIT_DIFF_FIND_REMOVE_UNMODIFIED sounds better
This commit is contained in:
parent
97ad85b88d
commit
f62c174d0d
@ -525,14 +525,14 @@ typedef enum {
|
|||||||
*/
|
*/
|
||||||
GIT_DIFF_BREAK_REWRITES_FOR_RENAMES_ONLY = (1u << 15),
|
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
|
* Using GIT_DIFF_FIND_COPIES_FROM_UNMODIFIED to emulate the
|
||||||
* --find-copies-harder behavior requires building a diff with the
|
* --find-copies-harder behavior requires building a diff with the
|
||||||
* GIT_DIFF_INCLUDE_UNMODIFIED flag. If you do not want UNMODIFIED
|
* GIT_DIFF_INCLUDE_UNMODIFIED flag. If you do not want UNMODIFIED
|
||||||
* records in the final result, pass this flag to have them removed.
|
* 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;
|
} git_diff_find_t;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -746,7 +746,7 @@ static bool is_rename_source(
|
|||||||
case GIT_DELTA_UNMODIFIED:
|
case GIT_DELTA_UNMODIFIED:
|
||||||
if (!FLAG_SET(opts, GIT_DIFF_FIND_COPIES_FROM_UNMODIFIED))
|
if (!FLAG_SET(opts, GIT_DIFF_FIND_COPIES_FROM_UNMODIFIED))
|
||||||
return false;
|
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;
|
delta->flags |= GIT_DIFF_FLAG__TO_DELETE;
|
||||||
break;
|
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(1, exp.file_status[GIT_DELTA_MODIFIED]);
|
||||||
cl_assert_equal_i(3, exp.file_status[GIT_DELTA_UNMODIFIED]);
|
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));
|
cl_git_pass(git_diff_find_similar(diff, &opts));
|
||||||
|
|
||||||
memset(&exp, 0, sizeof(exp));
|
memset(&exp, 0, sizeof(exp));
|
||||||
|
Loading…
Reference in New Issue
Block a user