@@ -30,6 +30,7 @@ static const char *diff_word_regex_cfg;
30
30
static const char * external_diff_cmd_cfg ;
31
31
int diff_auto_refresh_index = 1 ;
32
32
static int diff_mnemonic_prefix ;
33
+ static int diff_no_prefix ;
33
34
34
35
static char diff_colors [][COLOR_MAXLEN ] = {
35
36
GIT_COLOR_RESET ,
@@ -101,6 +102,10 @@ int git_diff_ui_config(const char *var, const char *value, void *cb)
101
102
diff_mnemonic_prefix = git_config_bool (var , value );
102
103
return 0 ;
103
104
}
105
+ if (!strcmp (var , "diff.noprefix" )) {
106
+ diff_no_prefix = git_config_bool (var , value );
107
+ return 0 ;
108
+ }
104
109
if (!strcmp (var , "diff.external" ))
105
110
return git_config_string (& external_diff_cmd_cfg , var , value );
106
111
if (!strcmp (var , "diff.wordregex" ))
@@ -2625,7 +2630,9 @@ void diff_setup(struct diff_options *options)
2625
2630
DIFF_OPT_SET (options , COLOR_DIFF );
2626
2631
options -> detect_rename = diff_detect_rename_default ;
2627
2632
2628
- if (!diff_mnemonic_prefix ) {
2633
+ if (diff_no_prefix ) {
2634
+ options -> a_prefix = options -> b_prefix = "" ;
2635
+ } else if (!diff_mnemonic_prefix ) {
2629
2636
options -> a_prefix = "a/" ;
2630
2637
options -> b_prefix = "b/" ;
2631
2638
}
0 commit comments