X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-config.c;h=a81bc8bbf033fac83ad6deecbf4a67ba44e06a0b;hb=5a0e4a2a326966aabb566164a7571291e34adabd;hp=1a3baa1f46f663580a3817c68353a262637560fa;hpb=ba048224685e661a4cf4736dcffab5fc60cbc70b;p=git.git diff --git a/builtin-config.c b/builtin-config.c index 1a3baa1f4..a81bc8bbf 100644 --- a/builtin-config.c +++ b/builtin-config.c @@ -55,7 +55,7 @@ static struct option builtin_config_options[] = { OPT_BIT(0, "get", &actions, "get value: name [value-regex]", ACTION_GET), OPT_BIT(0, "get-all", &actions, "get all values: key [value-regex]", ACTION_GET_ALL), OPT_BIT(0, "get-regexp", &actions, "get values for regexp: name-regex [value-regex]", ACTION_GET_REGEXP), - OPT_BIT(0, "replace-all", &actions, "replace all matching variables: name [value [value_regex]", ACTION_REPLACE_ALL), + OPT_BIT(0, "replace-all", &actions, "replace all matching variables: name value [value_regex]", ACTION_REPLACE_ALL), OPT_BIT(0, "add", &actions, "adds a new variable: name value", ACTION_ADD), OPT_BIT(0, "unset", &actions, "removes a variable: name [value-regex]", ACTION_UNSET), OPT_BIT(0, "unset-all", &actions, "removes all matches: name [value-regex]", ACTION_UNSET_ALL), @@ -390,6 +390,8 @@ int cmd_config(int argc, const char **argv, const char *unused_prefix) } else if (actions == ACTION_EDIT) { check_argc(argc, 0, 0); + if (!config_exclusive_filename && nongit) + die("not in a git directory"); git_config(git_default_config, NULL); launch_editor(config_exclusive_filename ? config_exclusive_filename : git_path("config"),