From: Junio C Hamano Date: Mon, 15 Feb 2010 06:38:30 GMT Subject: Re: [PATCH] require_work_tree broken with NONGIT_OK Message-ID: <7vzl3bj95l.fsf@alter.siamese.dyndns.org> In-Reply-To: <4B78C4D3.90407@gmail.com> Gabriel Filion 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. > die "fatal: $0 cannot be used without a working tree."