summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2011-05-23 09:59:05 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2011-05-23 09:59:05 -0700
commit6bb696c304d2bf27b267202af193d99cc7995370 (patch)
treef11a3b29867470f1b3e5d90f8f9b1b88930b5972 /builtin
parentMerge branch 'ab/i18n-scripts-basic' (diff)
parentconfig: Give error message when not changing a multivar (diff)
downloadtgif-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.c7
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);