Re: [PATCH v1] t9821: use test_config

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Sep 3, 2015 at 5:34 AM,  <larsxschneider@xxxxxxxxx> wrote:
> From: Lars Schneider <larsxschneider@xxxxxxxxx>
>
> Signed-off-by: Lars Schneider <larsxschneider@xxxxxxxxx>
> ---
> diff --git a/t/t9821-git-p4-path-variations.sh b/t/t9821-git-p4-path-variations.sh
> index 81e46ac..5a26fec 100755
> --- a/t/t9821-git-p4-path-variations.sh
> +++ b/t/t9821-git-p4-path-variations.sh
> @@ -45,7 +45,7 @@ test_expect_success 'Clone root' '
>         (
>                 cd "$git" &&
>                 git init . &&
> -               git config core.ignorecase false &&
> +               test_config core.ignorecase false &&

test_config ensures that the config setting gets "unset" at the end of
the test, whether the test succeeds or not, so that subsequent tests
are not affected by the setting. However, in this case, since the $git
repository gets recreated from scratch for each test anyhow, use of
test_config is superfluous. In fact, it may be slightly
contraindicated since it could mislead the reader into thinking that
state is carried over from test to test. (Not a big objections, but
something to take into consideration.)

>                 git p4 clone --use-client-spec --destination="$git" //depot &&
>                 # This method is used instead of "test -f" to ensure the case is
>                 # checked even if the test is executed on case-insensitive file systems.
> @@ -67,7 +67,7 @@ test_expect_success 'Clone root (ignorecase)' '
>         (
>                 cd "$git" &&
>                 git init . &&
> -               git config core.ignorecase true &&
> +               test_config core.ignorecase true &&
>                 git p4 clone --use-client-spec --destination="$git" //depot &&
>                 # This method is used instead of "test -f" to ensure the case is
>                 # checked even if the test is executed on case-insensitive file systems.
> @@ -91,7 +91,7 @@ test_expect_success 'Clone root and ignore one file' '
>         (
>                 cd "$git" &&
>                 git init . &&
> -               git config core.ignorecase false &&
> +               test_config core.ignorecase false &&
>                 git p4 clone --use-client-spec --destination="$git" //depot &&
>                 # We ignore one file in the client spec and all path cases change from
>                 # "TO" to "to"!
> @@ -113,7 +113,7 @@ test_expect_success 'Clone root and ignore one file (ignorecase)' '
>         (
>                 cd "$git" &&
>                 git init . &&
> -               git config core.ignorecase true &&
> +               test_config core.ignorecase true &&
>                 git p4 clone --use-client-spec --destination="$git" //depot &&
>                 # We ignore one file in the client spec and all path cases change from
>                 # "TO" to "to"!
> @@ -133,7 +133,7 @@ test_expect_success 'Clone path' '
>         (
>                 cd "$git" &&
>                 git init . &&
> -               git config core.ignorecase false &&
> +               test_config core.ignorecase false &&
>                 git p4 clone --use-client-spec --destination="$git" //depot &&
>                 cat >expect <<-\EOF &&
>                 to/File2.txt
> @@ -149,7 +149,7 @@ test_expect_success 'Clone path (ignorecase)' '
>         (
>                 cd "$git" &&
>                 git init . &&
> -               git config core.ignorecase true &&
> +               test_config core.ignorecase true &&
>                 git p4 clone --use-client-spec --destination="$git" //depot &&
>                 cat >expect <<-\EOF &&
>                 TO/File2.txt
> @@ -180,7 +180,7 @@ test_expect_success 'Add a new file and clone path with new file (ignorecase)' '
>         (
>                 cd "$git" &&
>                 git init . &&
> -               git config core.ignorecase true &&
> +               test_config core.ignorecase true &&
>                 git p4 clone --use-client-spec --destination="$git" //depot &&
>                 cat >expect <<-\EOF &&
>                 to/File0.txt
> --
> 1.9.5 (Apple Git-50.3)
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]