git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Nguyen Thai Ngoc Duy <pclouds@gmail.com>
To: "João Carlos Mendes Luís" <jonny@jonny.eng.br>
Cc: git@vger.kernel.org
Subject: Re: Unix root dir as a work tree
Date: Mon, 8 Feb 2010 09:18:25 +0700	[thread overview]
Message-ID: <fcaeb9bf1002071818j29fe919bve0ef2d1c4cac8a79@mail.gmail.com> (raw)
In-Reply-To: <4B6F6971.6000106@jonny.eng.br>

2010/2/8 João Carlos Mendes Luís <jonny@jonny.eng.br>:
>  Now, I have a patch that appears to work, but since I am a beginner to git,
> I don't know if this is the best way to implement it, if it has any side
> effects, or even if it works for other operating systems (probably they
> don't even have the bug).  Would any git wizard care to look at it, check if
> it is ok, and maybe commit in HEAD or give me any advice against my patch?

Hmm.. I guess you put .git at root directory so you needed your patch.
I haven't tried it yet because I don't have root access here.

Anyway you may also need the below patch. Please report back if any
Git operation that does not work under your setup.

diff --git a/setup.c b/setup.c
index 710e2f3..d31dcb8 100644
--- a/setup.c
+++ b/setup.c
@@ -25,7 +25,7 @@ const char *prefix_path(const char *prefix, int len,
const char *path)
 		len = strlen(work_tree);
 		total = strlen(sanitized) + 1;
 		if (strncmp(sanitized, work_tree, len) ||
-		    (sanitized[len] != '\0' && sanitized[len] != '/')) {
+		    (len > 1 && sanitized[len] != '\0' && sanitized[len] != '/')) {
 		error_out:
 			die("'%s' is outside repository", orig);
 		}

-- 
Duy

      parent reply	other threads:[~2010-02-08  2:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-08  1:31 Unix root dir as a work tree João Carlos Mendes Luís
2010-02-08  2:03 ` Nguyen Thai Ngoc Duy
2010-02-08 12:17   ` João Carlos Mendes Luís
2010-02-08  2:18 ` Nguyen Thai Ngoc Duy [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=fcaeb9bf1002071818j29fe919bve0ef2d1c4cac8a79@mail.gmail.com \
    --to=pclouds@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=jonny@jonny.eng.br \
    /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).