]> git.ipfire.org Git - thirdparty/git.git/blobdiff - setup.c
Merge branch 'kl/allow-working-in-dot-git-in-non-bare-repository'
[thirdparty/git.git] / setup.c
diff --git a/setup.c b/setup.c
index f4ad53d5454847951f2c55d02e9418484fdadac2..b69b1cbc2adb41aa5f4df8b1aff88761ea2cba5c 100644 (file)
--- a/setup.c
+++ b/setup.c
@@ -1371,7 +1371,8 @@ static enum discovery_result setup_git_directory_gently_1(struct strbuf *dir,
 
                if (is_git_directory(dir->buf)) {
                        trace2_data_string("setup", NULL, "implicit-bare-repository", dir->buf);
-                       if (get_allowed_bare_repo() == ALLOWED_BARE_REPO_EXPLICIT)
+                       if (get_allowed_bare_repo() == ALLOWED_BARE_REPO_EXPLICIT &&
+                           !ends_with_path_components(dir->buf, ".git"))
                                return GIT_DIR_DISALLOWED_BARE;
                        if (!ensure_valid_ownership(NULL, NULL, dir->buf, report))
                                return GIT_DIR_INVALID_OWNERSHIP;