{"thread":{"id":"51320","subject":"rev-parse --is-bare-repository incorrect when work tree is set","startedAt":"2019-06-15T02:11:06Z","lastAt":"2019-06-15T08:56:10Z","messageCount":2,"participants":["Sam Bazley","SZEDER Gábor"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"377290","messageId":"8ac7a1d8-9185-b527-67f4-d5e25cb3eaf5@fastmail.com","threadId":"51320","inReplyTo":null,"subject":"rev-parse --is-bare-repository incorrect when work tree is set","fromName":"Sam Bazley","fromEmail":"sambazley@fastmail.com","sentAt":"2019-06-15T01:59:50Z","receivedAt":"2019-06-15T02:11:06Z","isPatch":false,"sender":{"key":"sambazley@fastmail.com","avatar":null},"body":"rev-parse --is-bare-repository incorrectly outputs \"false\" when testing\na bare repository with the work tree set.\n\nTo reproduce:\n\n$ git init --bare testbare\n$ git --git-dir=testbare rev-parse --is-bare-repository\ntrue\n$ git --git-dir=testbare --work-tree=something rev-parse \\\n--is-bare-repository\nfalse\n$ GIT_WORK_TREE=something git --git-dir=testbare rev-parse \\\n--is-bare-repository\nfalse\n"},{"id":"377294","messageId":"20190615085602.GH31952@szeder.dev","threadId":"51320","inReplyTo":"8ac7a1d8-9185-b527-67f4-d5e25cb3eaf5@fastmail.com","subject":"Re: rev-parse --is-bare-repository incorrect when work tree is set","fromName":"SZEDER Gábor","fromEmail":"szeder.dev@gmail.com","sentAt":"2019-06-15T08:56:02Z","receivedAt":"2019-06-15T08:56:10Z","isPatch":false,"sender":{"key":"szeder.dev@gmail.com","avatar":"https://avatars.githubusercontent.com/u/116324?v=4"},"body":"On Sat, Jun 15, 2019 at 02:59:50AM +0100, Sam Bazley wrote:\n> rev-parse --is-bare-repository incorrectly outputs \"false\" when testing\n> a bare repository with the work tree set.\n> \n> To reproduce:\n> \n> $ git init --bare testbare\n> $ git --git-dir=testbare rev-parse --is-bare-repository\n> true\n> $ git --git-dir=testbare --work-tree=something rev-parse \\\n> --is-bare-repository\n> false\n> $ GIT_WORK_TREE=something git --git-dir=testbare rev-parse \\\n> --is-bare-repository\n> false\n\nA bare repository is a repository that doesn't have a worktree, and in\nthe last two cases you explicitly told git that it should treat\nsomething as a worktree, so it just acted accordingly.\n\n"}]}