Re: [PATCH 8/8] one ugly test to verify basic functionality

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

 



2016-02-05 9:57 GMT+01:00 Nguyễn Thái Ngọc Duy <pclouds@xxxxxxxxx>:
> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@xxxxxxxxx>
> ---
>  t/t5544-fetch-resume.sh (new +x) | 42 ++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 42 insertions(+)
>  create mode 100755 t/t5544-fetch-resume.sh
>
> diff --git a/t/t5544-fetch-resume.sh b/t/t5544-fetch-resume.sh
> new file mode 100755
> index 0000000..dfa033d
> --- /dev/null
> +++ b/t/t5544-fetch-resume.sh
> @@ -0,0 +1,42 @@
> +#!/bin/sh
> +
> +test_description='what'
> +
> +. ./test-lib.sh
> +
> +test_expect_success 'what' '
> +       test_commit one &&
> +       git clone --no-local .git abc &&
> +       (
> +       cd abc &&
> +       mv `ls .git/objects/pack/*.pack` pack &&

No, please. From the git coding guideline : "We prefer $( ... ) for
command substitution; unlike ``, it properly nests.
It should have been the way Bourne spelled it from day one, but
unfortunately isn't."

http://stackoverflow.com/questions/4708549/whats-the-difference-between-command-and-command-in-shell-programming

Thank you
> +       git unpack-objects < pack &&
> +       rm pack &&
> +       git fsck
> +       ) &&
> +       test_commit two &&
> +       test_commit three &&
> +       (
> +       cd abc &&
> +       git fetch --resume-pack=foo origin HEAD &&
> +       git log --format=%s origin/master >actual &&
> +       echo one >expected &&
> +       test_cmp expected actual &&
> +       rm .git/FETCH_HEAD &&
> +       mv `ls .git/objects/pack/*.pack` pack &&
> +       head -c 123 pack >tmp &&
> +       git fetch --resume-pack=tmp origin &&
> +       test_path_is_missing tmp &&
> +       cmp pack .git/objects/pack/*.pack &&
> +       git fsck &&
> +       git log --format=%s origin/master >actual &&
> +       cat >expected <<EOF &&
> +three
> +two
> +one
> +EOF
> +       test_cmp expected actual
> +       )
> +'
> +
> +test_done
> --
> 2.7.0.377.g4cd97dd
>
> --
> 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
--
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]