Add "const" qualifier to "char *excludes_file".
Also use "git_config_string" to simplify "config.c" code where "excludes_file" is set. Signed-off-by: Christian Couder <chriscool@tuxfamily.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Christian Couder committed
Feb 16, 2008 at 06:01 UTC
dfb068be8deef2065970b2a7889acc51abf4dd78
3 files changed
+4
-8
cache.h
+1
-1
@@ -615,7 +615,7 @@ extern int pager_in_use(void);
615
extern int pager_use_color;
616
617
extern const char *editor_program;
618
-extern char *excludes_file;
618
+extern const char *excludes_file;
619
620
/* base85 */
621
int decode_85(char *dst, const char *line, int linelen);
config.c
+2
-6
@@ -446,12 +446,8 @@ int git_default_config(const char *var, const char *value)
446
if (!strcmp(var, "core.editor"))
447
return git_config_string(&editor_program, var, value);
448
449
- if (!strcmp(var, "core.excludesfile")) {
450
- if (!value)
451
- return config_error_nonbool(var);
452
- excludes_file = xstrdup(value);
453
- return 0;
454
- }
449
+ if (!strcmp(var, "core.excludesfile"))
450
+ return git_config_string(&excludes_file, var, value);
451
452
if (!strcmp(var, "core.whitespace")) {
453
if (!value)
environment.c
+1
-1
@@ -33,7 +33,7 @@ size_t delta_base_cache_limit = 16 * 1024 * 1024;
33
const char *pager_program;
34
int pager_use_color = 1;
35
const char *editor_program;
36
-char *excludes_file;
36
+const char *excludes_file;
37
int auto_crlf = 0; /* 1: both ways, -1: only when adding git objects */
38
unsigned whitespace_rule_cfg = WS_DEFAULT_RULE;
39