git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Schindelin <Johannes.Schindelin@gmx.de>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Petr Baudis <pasky@suse.cz>
Subject: Re: [PATCH/RFH] Fix initialization of a bare repository
Date: Mon, 27 Aug 2007 11:54:48 +0100 (BST)	[thread overview]
Message-ID: <Pine.LNX.4.64.0708271154020.28586@racer.site> (raw)
In-Reply-To: <7v7inhmmsx.fsf_-_@gitster.siamese.dyndns.org>

Hi,

how about this on top (or squashed):

-- snipsnap --

 builtin-init-db.c |    4 +++-
 t/t0001-init.sh   |   11 +++++++++++
 2 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/builtin-init-db.c b/builtin-init-db.c
index ec90b66..af15cb2 100644
--- a/builtin-init-db.c
+++ b/builtin-init-db.c
@@ -288,8 +288,10 @@ static void guess_repository_type(const char *git_dir)
 	if (!strcmp(git_dir, cwd))
 		goto force_bare;
 	/*
-	 * "GIT_DIR=something/.git is usually not.
+	 * "GIT_DIR=.git or GIT_DIR=something/.git is usually not.
 	 */
+	if (!strcmp(git_dir, ".git"))
+		return;
 	slash = strrchr(git_dir, '/');
 	if (slash && !strcmp(slash, "/.git"))
 		return;
diff --git a/t/t0001-init.sh b/t/t0001-init.sh
index 333abb2..b14b3ec 100755
--- a/t/t0001-init.sh
+++ b/t/t0001-init.sh
@@ -79,6 +79,17 @@ test_expect_success 'GIT_DIR bare' '
 	check_config git-dir-bare.git true unset
 '
 
+test_expect_success 'GIT_DIR non-bare' '
+
+	(
+		unset GIT_CONFIG &&
+		mkdir non-bare &&
+		cd non-bare &&
+		GIT_DIR=.git git init
+	) &&
+	check_config non-bare/.git false unset
+'
+
 test_expect_success 'GIT_DIR & GIT_WORK_TREE (1)' '
 
 	(

      reply	other threads:[~2007-08-27 10:52 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-15 12:28 git clone regression Junio C Hamano
2007-08-15 16:25 ` [PATCH] Fix initialization of a bare repository Johannes Schindelin
2007-08-15 19:09   ` Junio C Hamano
2007-08-15 19:26     ` Junio C Hamano
2007-08-15 20:41   ` Junio C Hamano
2007-08-17 22:20     ` Johannes Schindelin
2007-08-27  7:58     ` [PATCH/RFH] " Junio C Hamano
2007-08-27 10:54       ` Johannes Schindelin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Pine.LNX.4.64.0708271154020.28586@racer.site \
    --to=johannes.schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=pasky@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).