Re: [PATCH 03/18] lib-submodule-update: teach test_submodule_content the -C <dir> flag
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Mar 6, 2017, 22:21 UTC
- Message-ID
- <xmqqo9xem4gk.fsf@junio-linux.mtv.corp.google.com>
- In-Reply-To
- <20170306205919.9713-4-sbeller@google.com>
Stefan Beller <sbeller@google.com> writes:
Show 17 quoted lines
> Signed-off-by: Stefan Beller <sbeller@google.com>
> ---
> t/lib-submodule-update.sh | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/t/lib-submodule-update.sh b/t/lib-submodule-update.sh
> index c0d6325133..00128f28b5 100755
> --- a/t/lib-submodule-update.sh
> +++ b/t/lib-submodule-update.sh
> @@ -193,6 +193,11 @@ test_superproject_content () {
> # Test that the given submodule at path "$1" contains the content according
> # to the submodule commit recorded in the superproject's commit "$2"
> test_submodule_content () {
> + if test x"$1" = "x-C"
> + then
> + cd "$2"
> + shift; shift;That's old fashoned like me ;-)
It seems "shift [<n>]" is already used elsewhere in our test scripts without getting complaints.
'git-difftool-helper.sh' is the only one that uses number above 1 in the scripted Porcelains, so it is possible that an esoteric platform without a shell that understands it may be built and used _without_ passing our test suite, so I'd be wary of using it in the scripted Porcelains, but this is part of the test suite, so I would think it is OK.
> + fi > if test $# != 2 > then > echo "test_submodule_content needs two arguments"