Re: [PATCH] t7400: fix bogus test failure with symlinked trash
- From
Jens Lehmann <jens.lehmann@web.de>
- Date
- Jul 30, 2011, 10:41 UTC
- Message-ID
- <4E33DFD6.9050709@web.de>
- In-Reply-To
- <20110730003609.GA6089@sigill.intra.peff.net>
Am 30.07.2011 02:36, schrieb Jeff King:
Show 5 quoted lines
> This feels a little funny, because we are probably using the same > "convert relative to absolute" code to generate our expected value, as > well as in the test itself. So any bug in that code is likely to be > masked. But this test isn't really about checking the absolute path > code, but rather making sure that it is invoked properly.
While the patch itself is good (apart from using backticks, I think a "$()" should be used there), I share your concerns about loosing an opportunity to test git functionality against the real world.
What about doing the following instead?
submodurl=$(cd "$TRASH_DIRECTORY"; pwd -P)
(That pattern is already used in t/t0000-basic.sh)
But that is just nitpicking ...
Show 16 quoted lines
> t/t7400-submodule-basic.sh | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/t/t7400-submodule-basic.sh b/t/t7400-submodule-basic.sh
> index 5afe6cc..12200ca 100755
> --- a/t/t7400-submodule-basic.sh
> +++ b/t/t7400-submodule-basic.sh
> @@ -48,7 +48,7 @@ test_expect_success 'setup - repository to add submodules to' '
>
> # The 'submodule add' tests need some repository to add as a submodule.
> # The trash directory is a good one as any.
> -submodurl=$TRASH_DIRECTORY
> +submodurl=`git rev-parse --show-toplevel`
>
> listbranches() {
> git for-each-ref --format='%(refname)' 'refs/heads/*'