git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* rev-parse --is-bare-repository incorrect when work tree is set
@ 2019-06-15  1:59 Sam Bazley
  2019-06-15  8:56 ` SZEDER Gábor
  0 siblings, 1 reply; 2+ messages in thread
From: Sam Bazley @ 2019-06-15  1:59 UTC (permalink / raw)
  To: git

rev-parse --is-bare-repository incorrectly outputs "false" when testing
a bare repository with the work tree set.

To reproduce:

$ git init --bare testbare
$ git --git-dir=testbare rev-parse --is-bare-repository
true
$ git --git-dir=testbare --work-tree=something rev-parse \
--is-bare-repository
false
$ GIT_WORK_TREE=something git --git-dir=testbare rev-parse \
--is-bare-repository
false

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: rev-parse --is-bare-repository incorrect when work tree is set
  2019-06-15  1:59 rev-parse --is-bare-repository incorrect when work tree is set Sam Bazley
@ 2019-06-15  8:56 ` SZEDER Gábor
  0 siblings, 0 replies; 2+ messages in thread
From: SZEDER Gábor @ 2019-06-15  8:56 UTC (permalink / raw)
  To: Sam Bazley; +Cc: git

On Sat, Jun 15, 2019 at 02:59:50AM +0100, Sam Bazley wrote:
> rev-parse --is-bare-repository incorrectly outputs "false" when testing
> a bare repository with the work tree set.
> 
> To reproduce:
> 
> $ git init --bare testbare
> $ git --git-dir=testbare rev-parse --is-bare-repository
> true
> $ git --git-dir=testbare --work-tree=something rev-parse \
> --is-bare-repository
> false
> $ GIT_WORK_TREE=something git --git-dir=testbare rev-parse \
> --is-bare-repository
> false

A bare repository is a repository that doesn't have a worktree, and in
the last two cases you explicitly told git that it should treat
something as a worktree, so it just acted accordingly.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-06-15  8:56 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-06-15  1:59 rev-parse --is-bare-repository incorrect when work tree is set Sam Bazley
2019-06-15  8:56 ` SZEDER Gábor

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).