diff options
author | Junio C Hamano <junkio@cox.net> | 2006-12-17 18:27:17 -0800 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-12-17 18:27:17 -0800 |
commit | bdf17a02fd3224c5308c6451a6965476626f0578 (patch) | |
tree | fdb8c10d374076eb5612b67b8101a624f615e06c /builtin-repo-config.c | |
parent | 9057695012daec51980eed19947a848f93f91503 (diff) | |
parent | dc81c58cd6b791a3db23f1d1acb5f7d38d1ff086 (diff) | |
download | git-bdf17a02fd3224c5308c6451a6965476626f0578.tar.gz git-bdf17a02fd3224c5308c6451a6965476626f0578.tar.xz |
Merge branch 'js/branch-config'
* js/branch-config:
git-branch: rename config vars branch.<branch>.*, too
add a function to rename sections in the config
Diffstat (limited to 'builtin-repo-config.c')
-rw-r--r-- | builtin-repo-config.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/builtin-repo-config.c b/builtin-repo-config.c index 64fbdb7b2..a38099a63 100644 --- a/builtin-repo-config.c +++ b/builtin-repo-config.c @@ -3,7 +3,7 @@ #include <regex.h> static const char git_config_set_usage[] = -"git-repo-config [ --global ] [ --bool | --int ] [--get | --get-all | --get-regexp | --replace-all | --add | --unset | --unset-all] name [value [value_regex]] | --list"; +"git-repo-config [ --global ] [ --bool | --int ] [--get | --get-all | --get-regexp | --replace-all | --add | --unset | --unset-all] name [value [value_regex]] | --rename-section old_name new_name | --list"; static char *key; static regex_t *key_regexp; @@ -148,6 +148,18 @@ int cmd_repo_config(int argc, const char **argv, const char *prefix) } else { die("$HOME not set"); } + } else if (!strcmp(argv[1], "--rename-section")) { + int ret; + if (argc != 4) + usage(git_config_set_usage); + ret = git_config_rename_section(argv[2], argv[3]); + if (ret < 0) + return ret; + if (ret == 0) { + fprintf(stderr, "No such section!\n"); + return 1; + } + return 0; } else break; argc--; |