Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Contreras <felipe.contreras@gmail.com>2009-04-30 02:49:47 +0400
committerJunio C Hamano <gitster@pobox.com>2009-04-30 03:50:21 +0400
commitd212ca1724b1a3708a3b4cb72c58b20ef442b24f (patch)
tree95664c55c15108262eaa884e82ba5d4bceb4f8e0 /builtin-config.c
parent2163e3f7786f56d5aaf9eadea6776bb0e38b30a4 (diff)
git config: error when editing a repo config and not being in one
Let's throw an error on this specific case. If the user specifies the config file, he must know what he is doing. Teemu Likonen pointed this out. Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-config.c')
-rw-r--r--builtin-config.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/builtin-config.c b/builtin-config.c
index d8da72cf20..a81bc8bbf0 100644
--- a/builtin-config.c
+++ b/builtin-config.c
@@ -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"),