File tree Expand file tree Collapse file tree 3 files changed +13
-5
lines changed Expand file tree Collapse file tree 3 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -161,9 +161,9 @@ static void determine_whence(struct wt_status *s)
161
161
static void status_init_config (struct wt_status * s , config_fn_t fn )
162
162
{
163
163
wt_status_prepare (s );
164
+ init_diff_ui_defaults ();
164
165
git_config (fn , s );
165
166
determine_whence (s );
166
- init_diff_ui_defaults ();
167
167
s -> hints = advice_status_hints ; /* must come after git_config() */
168
168
}
169
169
Original file line number Diff line number Diff line change @@ -138,6 +138,18 @@ test_expect_success 'favour same basenames over different ones' '
138
138
test_i18ngrep "renamed: .*path1 -> subdir/path1" out
139
139
'
140
140
141
+ test_expect_success ' test diff.renames=true for git status' '
142
+ git -c diff.renames=true status >out &&
143
+ test_i18ngrep "renamed: .*path1 -> subdir/path1" out
144
+ '
145
+
146
+ test_expect_success ' test diff.renames=false for git status' '
147
+ git -c diff.renames=false status >out &&
148
+ test_i18ngrep ! "renamed: .*path1 -> subdir/path1" out &&
149
+ test_i18ngrep "new file: .*subdir/path1" out &&
150
+ test_i18ngrep "deleted: .*[^/]path1" out
151
+ '
152
+
141
153
test_expect_success ' favour same basenames even with minor differences' '
142
154
git show HEAD:path1 | sed "s/15/16/" > subdir/path1 &&
143
155
git status >out &&
Original file line number Diff line number Diff line change @@ -625,9 +625,6 @@ static void wt_status_collect_changes_index(struct wt_status *s)
625
625
rev .diffopt .output_format |= DIFF_FORMAT_CALLBACK ;
626
626
rev .diffopt .format_callback = wt_status_collect_updated_cb ;
627
627
rev .diffopt .format_callback_data = s ;
628
- rev .diffopt .detect_rename = DIFF_DETECT_RENAME ;
629
- rev .diffopt .rename_limit = 200 ;
630
- rev .diffopt .break_opt = 0 ;
631
628
copy_pathspec (& rev .prune_data , & s -> pathspec );
632
629
run_diff_index (& rev , 1 );
633
630
}
@@ -985,7 +982,6 @@ static void wt_longstatus_print_verbose(struct wt_status *s)
985
982
setup_revisions (0 , NULL , & rev , & opt );
986
983
987
984
rev .diffopt .output_format |= DIFF_FORMAT_PATCH ;
988
- rev .diffopt .detect_rename = DIFF_DETECT_RENAME ;
989
985
rev .diffopt .file = s -> fp ;
990
986
rev .diffopt .close_file = 0 ;
991
987
/*
You can’t perform that action at this time.
0 commit comments