diff options
author | Carlos Rica <jasampler@gmail.com> | 2009-03-17 10:46:37 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-03-17 09:30:00 -0700 |
commit | bf71b4b3ee07291e97c4dabfb97e7397eec904e0 (patch) | |
tree | 242ed48989dad56a158149758e4a600bccc0fa44 | |
parent | ba048224685e661a4cf4736dcffab5fc60cbc70b (diff) | |
download | git-bf71b4b3ee07291e97c4dabfb97e7397eec904e0.tar.gz |
config: test for --replace-all with one argument and fix documentation.
Option --replace-all only allows at least two arguments, so
documentation was needing to be updated accordingly. A test showing
that the command fails with only one parameter is also provided.
Signed-off-by: Carlos Rica <jasampler@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r-- | Documentation/git-config.txt | 2 | ||||
-rw-r--r-- | builtin-config.c | 2 | ||||
-rwxr-xr-x | t/t1300-repo-config.sh | 9 |
3 files changed, 10 insertions, 3 deletions
diff --git a/Documentation/git-config.txt b/Documentation/git-config.txt index 7d140073b1..8b94f19b17 100644 --- a/Documentation/git-config.txt +++ b/Documentation/git-config.txt @@ -11,7 +11,7 @@ SYNOPSIS [verse] 'git config' [<file-option>] [type] [-z|--null] name [value [value_regex]] 'git config' [<file-option>] [type] --add name value -'git config' [<file-option>] [type] --replace-all name [value [value_regex]] +'git config' [<file-option>] [type] --replace-all name value [value_regex] 'git config' [<file-option>] [type] [-z|--null] --get name [value_regex] 'git config' [<file-option>] [type] [-z|--null] --get-all name [value_regex] 'git config' [<file-option>] [type] [-z|--null] --get-regexp name_regex [value_regex] diff --git a/builtin-config.c b/builtin-config.c index 1a3baa1f46..d8da72cf20 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), diff --git a/t/t1300-repo-config.sh b/t/t1300-repo-config.sh index 11b82f43dd..f0a75380b3 100755 --- a/t/t1300-repo-config.sh +++ b/t/t1300-repo-config.sh @@ -118,7 +118,14 @@ EOF test_expect_success 'multiple unset is correct' 'cmp .git/config expect' -mv .git/config2 .git/config +cp .git/config2 .git/config + +test_expect_success '--replace-all missing value' ' + test_must_fail git config --replace-all beta.haha && + test_cmp .git/config2 .git/config +' + +rm .git/config2 test_expect_success '--replace-all' \ 'git config --replace-all beta.haha gamma' |