[PATCH] Checking for "diff.color." should come before "diff.color"

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



In git_diff_ui_config() the strncmp() for "diff.color" would have matched for
"diff.color.", so "diff.color." configs would never be processed.

Fix is to move "diff.color." check before "diff.color"
Signed-off-by: Andy Parkins <andyparkins@xxxxxxxxx>
---
 diff.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/diff.c b/diff.c
index 3315378..d795be4 100644
--- a/diff.c
+++ b/diff.c
@@ -60,10 +60,6 @@ int git_diff_ui_config(const char *var, 
 		diff_rename_limit_default = git_config_int(var, value);
 		return 0;
 	}
-	if (!strcmp(var, "diff.color")) {
-		diff_use_color_default = git_config_colorbool(var, value);
-		return 0;
-	}
 	if (!strcmp(var, "diff.renames")) {
 		if (!value)
 			diff_detect_rename_default = DIFF_DETECT_RENAME;
@@ -79,6 +75,10 @@ int git_diff_ui_config(const char *var, 
 		color_parse(value, var, diff_colors[slot]);
 		return 0;
 	}
+	if (!strcmp(var, "diff.color")) {
+		diff_use_color_default = git_config_colorbool(var, value);
+		return 0;
+	}
 	return git_default_config(var, value);
 }
 
-- 
1.4.2.3

-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]