git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] require_work_tree broken with NONGIT_OK

From
Gabriel Filion <lelutin@gmail.com>
Date
Feb 15, 2010, 07:24 UTC
Message-ID
<4B78F6CB.2070304@gmail.com>
In-Reply-To
<7vzl3bj95l.fsf@alter.siamese.dyndns.org>
On 2010-02-15 01:38, Junio C Hamano wrote:
Show 20 quoted lines
> Gabriel Filion <lelutin@gmail.com> writes:
> 
>> diff --git a/git-sh-setup.sh b/git-sh-setup.sh
>> index d56426d..8de2f03 100755
>> --- a/git-sh-setup.sh
>> +++ b/git-sh-setup.sh
>> @@ -128,7 +128,7 @@ cd_to_toplevel () {
>>  }
>>   require_work_tree () {
>> -	test $(git rev-parse --is-inside-work-tree) = true ||
> 
> This needs to have dq around it, as "Not a git repository" case we fatal
> out without any output, like this:
> 
> 	test "$(git rev-parse --is-inside-work-tree 2>/dev/null)" = true ||
> 
>> +	test git rev-parse --is-inside-work-tree >/dev/null 2>&1 ||
> 
> I don't think this would ever work with "test" at the beginning.
> 

Well, it would seem you are right! my bad for thinking that "test" was actually evaluating any command given in the expression :\

Your implementation seems to be working better and fixes the problem. Thanks for reviewing the patch.

-- 
Gabriel Filion
Previous: Junio C HamanoNext: Jeff King
Message 4 of 6 in “require_work_tree broken with NONGIT_OK”
  1. require_work_tree broken with NONGIT_OKGabriel Filion, Feb 15, 2010
  2. Jeff KingFeb 15, 2010
  3. Junio C HamanoFeb 15, 2010
  4. Gabriel FilionFeb 15, 2010
  5. Jeff KingFeb 15, 2010
  6. Gabriel FilionFeb 15, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.