Use DIFF_DETECT_RENAME for detect_rename assignments
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Wed, 27 Dec 2017 10:18:35 +0000 (17:18 +0700)
committerJunio C Hamano <gitster@pobox.com>
Wed, 27 Dec 2017 20:38:35 +0000 (12:38 -0800)
This field can have two values (2 for copy). Use this name instead for
clarity. Many places have already used this constant.

Note, the detect_rename assignments in merge-recursive.c remain
unchanged because it's actually a boolean there.

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/commit.c
diff.c
wt-status.c
index aff6bf7aadc6f5209d5f8fc22dfde055a96214c4..4ad45a81a8354be1d250c176350a90c61b8bce14 100644 (file)
@@ -1473,7 +1473,7 @@ static void print_summary(const char *prefix, const struct object_id *oid,
        rev.show_root_diff = 1;
        get_commit_format(format.buf, &rev);
        rev.always_show_header = 0;
-       rev.diffopt.detect_rename = 1;
+       rev.diffopt.detect_rename = DIFF_DETECT_RENAME;
        rev.diffopt.break_opt = 0;
        diff_setup_done(&rev.diffopt);
 
diff --git a/diff.c b/diff.c
index 74283d9001fbc48d11ba5c449ea7c16692791c88..4359e3be688127095dd478949830106f8be5d2ba 100644 (file)
--- a/diff.c
+++ b/diff.c
@@ -218,7 +218,7 @@ static int parse_ws_error_highlight(const char *arg)
  */
 void init_diff_ui_defaults(void)
 {
-       diff_detect_rename_default = 1;
+       diff_detect_rename_default = DIFF_DETECT_RENAME;
 }
 
 int git_diff_heuristic_config(const char *var, const char *value, void *cb)
index 068de38b510f51ba216e7bfdfe969c526064aef7..7491c3adeb2823214ba5840297f85c68fa17e4d0 100644 (file)
@@ -603,7 +603,7 @@ static void wt_status_collect_changes_index(struct wt_status *s)
        rev.diffopt.output_format |= DIFF_FORMAT_CALLBACK;
        rev.diffopt.format_callback = wt_status_collect_updated_cb;
        rev.diffopt.format_callback_data = s;
-       rev.diffopt.detect_rename = 1;
+       rev.diffopt.detect_rename = DIFF_DETECT_RENAME;
        rev.diffopt.rename_limit = 200;
        rev.diffopt.break_opt = 0;
        copy_pathspec(&rev.prune_data, &s->pathspec);
@@ -937,7 +937,7 @@ static void wt_longstatus_print_verbose(struct wt_status *s)
        setup_revisions(0, NULL, &rev, &opt);
 
        rev.diffopt.output_format |= DIFF_FORMAT_PATCH;
-       rev.diffopt.detect_rename = 1;
+       rev.diffopt.detect_rename = DIFF_DETECT_RENAME;
        rev.diffopt.file = s->fp;
        rev.diffopt.close_file = 0;
        /*