Commit f62c174d0d88c3e491fe3f4e3490959edb7cae1b

Russell Belfer 2013-12-02T13:49:58

GIT_DIFF_FIND_REMOVE_UNMODIFIED sounds better

diff --git a/include/git2/diff.h b/include/git2/diff.h
index 51ad349..db6bce2 100644
--- a/include/git2/diff.h
+++ b/include/git2/diff.h
@@ -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;
 
 /**
diff --git a/src/diff_tform.c b/src/diff_tform.c
index bff821d..0a28e58 100644
--- a/src/diff_tform.c
+++ b/src/diff_tform.c
@@ -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;
 
diff --git a/tests/diff/rename.c b/tests/diff/rename.c
index e081d61..919f513 100644
--- a/tests/diff/rename.c
+++ b/tests/diff/rename.c
@@ -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));