Re: [PATCH] difftool: fix bug when printing usage
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Feb 7, 2017, 11:21 UTC
- Message-ID
- <alpine.DEB.2.20.1702071220290.3496@virtualbox>
- In-Reply-To
- <xmqqinon2nnt.fsf@gitster.mtv.corp.google.com>
Hi Junio,
On Mon, 6 Feb 2017, Junio C Hamano wrote:
Show 22 quoted lines
> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes: > > > [... and he quoted someone ...] > > > >> + # create a ceiling directory to prevent Git from finding a repo > >> + mkdir -p not/repo && > >> + ceiling="$PWD/not" && > >> + lines=$(cd not/repo && > >> + GIT_CEILING_DIRECTORIES="$ceiling" git difftool -h | > >> + grep ^usage: | wc -l) && > >> + test "$lines" -eq 1 && > > > > Likewise, this would become > > > > GIT_CEILING_DIRECTORIES="$PWD/not" \ > > test_expect_code 129 git -C not/repo difftool -h >output && > > grep ^usage: output > > I agree with the intent, but the execution here is "Not quite". > test_expect_code being a shell function, it does not take the > "one-shot environment assignment for this single invocation," like > external commands do.
So now that we know what is wrong, can you please enlighten me about what is right?
Thanks, Johannes