X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=sidebyside;f=builtin-config.c;h=d52a05744487182cfcd9e974ad1fb8c65e3eca89;hb=7ee3760e2c8f181f22d4b80afc03309e4f764385;hp=6937eaf379aa060ece1bbbfbb3a830c1a349bfe6;hpb=3bec8ff99a7792cae67aaeb5892d832478d7f548;p=git.git diff --git a/builtin-config.c b/builtin-config.c index 6937eaf37..d52a05744 100644 --- a/builtin-config.c +++ b/builtin-config.c @@ -27,7 +27,7 @@ static int show_all_config(const char *key_, const char *value_, void *cb) return 0; } -static int show_config(const char* key_, const char* value_, void *cb) +static int show_config(const char *key_, const char *value_, void *cb) { char value[256]; const char *vptr = value; @@ -74,7 +74,7 @@ static int show_config(const char* key_, const char* value_, void *cb) return 0; } -static int get_value(const char* key_, const char* regex_) +static int get_value(const char *key_, const char *regex_) { int ret = -1; char *tl; @@ -284,7 +284,7 @@ static int get_colorbool(int argc, const char **argv) int cmd_config(int argc, const char **argv, const char *prefix) { int nongit; - char* value; + char *value; const char *file = setup_git_directory_gently(&nongit); config_exclusive_filename = getenv(CONFIG_ENVIRONMENT); @@ -363,15 +363,12 @@ int cmd_config(int argc, const char **argv, const char *prefix) } else if (!strcmp(argv[1], "--get-colorbool")) { return get_colorbool(argc-2, argv+2); } else if (!strcmp(argv[1], "--edit") || !strcmp(argv[1], "-e")) { - const char *config_filename; if (argc != 2) usage(git_config_set_usage); - if (config_exclusive_filename) - config_filename = config_exclusive_filename; - else - config_filename = git_path("config"); git_config(git_default_config, NULL); - launch_editor(config_filename, NULL, NULL); + launch_editor(config_exclusive_filename ? + config_exclusive_filename : git_path("config"), + NULL, NULL); return 0; } else break;