diff options
author | Junio C Hamano <gitster@pobox.com> | 2011-05-23 09:59:05 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-05-23 09:59:05 -0700 |
commit | 6bb696c304d2bf27b267202af193d99cc7995370 (patch) | |
tree | f11a3b29867470f1b3e5d90f8f9b1b88930b5972 /builtin | |
parent | Merge branch 'ab/i18n-scripts-basic' (diff) | |
parent | config: Give error message when not changing a multivar (diff) | |
download | tgif-6bb696c304d2bf27b267202af193d99cc7995370.tar.xz |
Merge branch 'mg/config-symbolic-constants'
* mg/config-symbolic-constants:
config: Give error message when not changing a multivar
config: define and document exit codes
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/config.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/builtin/config.c b/builtin/config.c index 3e3c528497..211e118d57 100644 --- a/builtin/config.c +++ b/builtin/config.c @@ -436,9 +436,14 @@ int cmd_config(int argc, const char **argv, const char *prefix) NULL, NULL); } else if (actions == ACTION_SET) { + int ret; check_argc(argc, 2, 2); value = normalize_value(argv[0], argv[1]); - return git_config_set(argv[0], value); + ret = git_config_set(argv[0], value); + if (ret == CONFIG_NOTHING_SET) + error("cannot overwrite multiple values with a single value\n" + " Use a regexp, --add or --set-all to change %s.", argv[0]); + return ret; } else if (actions == ACTION_SET_ALL) { check_argc(argc, 2, 3); |