summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c5e5a2c)
raw | patch | inline | side by side (parent: c5e5a2c)
author | Junio C Hamano <gitster@pobox.com> | |
Mon, 11 Feb 2008 18:41:18 +0000 (10:41 -0800) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Mon, 11 Feb 2008 21:11:36 +0000 (13:11 -0800) |
This is used to report misconfigured configuration file that does not
give any value to a non-boolean variable, e.g.
[section]
var
It is perfectly fine to say it if the section.var is a boolean (it means
true), but if a variable expects a string value it should be flagged as
a configuration error.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
give any value to a non-boolean variable, e.g.
[section]
var
It is perfectly fine to say it if the section.var is a boolean (it means
true), but if a variable expects a string value it should be flagged as
a configuration error.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
cache.h | patch | blob | history | |
config.c | patch | blob | history |
index 549f4bbac7242714283e58dd576460ca86015d52..6abcee437238ccc2b46e7d7d74f79db3a4b682a1 100644 (file)
--- a/cache.h
+++ b/cache.h
@@ -589,6 +589,7 @@ extern int git_config_set_multivar(const char *, const char *, const char *, int
extern int git_config_rename_section(const char *, const char *);
extern const char *git_etc_gitconfig(void);
extern int check_repository_format_version(const char *var, const char *value);
+extern int config_error_nonbool(const char *);
#define MAX_GITNAME (1000)
extern char git_default_email[MAX_GITNAME];
diff --git a/config.c b/config.c
index e799f40db74fd1f40849dcec21e997f165a52e35..03c94a27043681678ad6dd08df6de5c6b7cb4dc7 100644 (file)
--- a/config.c
+++ b/config.c
free(config_filename);
return ret;
}
+
+/*
+ * Call this to report error for your variable that should not
+ * get a boolean value (i.e. "[my] var" means "true").
+ */
+int config_error_nonbool(const char *var)
+{
+ return error("Missing value for '%s'", var);
+}