Commits

Anonymous committed 70cff3a

builtin-log.c: Use 'git_config_string' to get 'format.subjectprefix' and 'format.suffix'

Signed-off-by: Brian Hetro <whee@smaertness.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

Comments (0)

Files changed (1)

 {
 	if (!strcmp(var, "format.pretty"))
 		return git_config_string(&fmt_pretty, var, value);
-	if (!strcmp(var, "format.subjectprefix")) {
-		if (!value)
-			config_error_nonbool(var);
-		fmt_patch_subject_prefix = xstrdup(value);
-		return 0;
-	}
+	if (!strcmp(var, "format.subjectprefix"))
+		return git_config_string(&fmt_patch_subject_prefix, var, value);
 	if (!strcmp(var, "log.date"))
 		return git_config_string(&default_date_mode, var, value);
 	if (!strcmp(var, "log.showroot")) {
 		add_header(value);
 		return 0;
 	}
-	if (!strcmp(var, "format.suffix")) {
-		if (!value)
-			return config_error_nonbool(var);
-		fmt_patch_suffix = xstrdup(value);
-		return 0;
-	}
+	if (!strcmp(var, "format.suffix"))
+		return git_config_string(&fmt_patch_suffix, var, value);
 	if (!strcmp(var, "format.cc")) {
 		if (!value)
 			return config_error_nonbool(var);