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
path: root/git.c
diff options
context:
space:
mode:
Diffstat (limited to 'git.c')
-rw-r--r--git.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/git.c b/git.c
index fb03a547de..82a8357272 100644
--- a/git.c
+++ b/git.c
@@ -299,8 +299,9 @@ static void handle_internal_command(int argc, const char **argv, char **envp)
prefix = setup_git_directory();
if (p->option & USE_PAGER)
setup_pager();
- if ((p->option & NOT_BARE) && is_bare_repository())
- die("%s cannot be used in a bare git directory", cmd);
+ if ((p->option & NOT_BARE) &&
+ (is_bare_repository() || is_inside_git_dir()))
+ die("%s must be run in a work tree", cmd);
trace_argv_printf(argv, argc, "trace: built-in: git");
exit(p->fn(argc, argv, prefix));