From: Duy Nguyen Date: Sat, 23 May 2015 11:42:57 GMT Subject: Re: git status doesn't ignore GIT_DIR directory? Message-ID: In-Reply-To: <20150523053900.GA2364@glandium.org> On Sat, May 23, 2015 at 12:39 PM, Mike Hommey wrote: > On Sat, May 23, 2015 at 09:22:56AM +0700, Duy Nguyen wrote: >> --- a/Documentation/git.txt >> +++ b/Documentation/git.txt >> @@ -691,6 +691,9 @@ Git so take care if using Cogito etc. >> specifies a path to use instead of the default `.git` >> for the base of the repository. >> The '--git-dir' command-line option also sets this value. >> ++ >> +Note that if GIT_DIR is set explicitly to a directory inside working >> +tree, the directory name must be ".git". > > Isn't the requirement that it _ends_ with ".git" (that is, > GIT_DIR=/path/to/foo.git would work) If $GIT_DIR points to somewhere inside worktree, ".git" exactly (it's strcmp(), not ends_with()) is the only exception. If it points outside worktree, the directory name could be anything. -- Duy