On 3/8/19 10:57 AM, Nguyễn Thái Ngọc Duy wrote:
> ---
>  t/t2060-switch.sh | 87 +++++++++++++++++++++++++++++++++++++++++++++++
>  1 file changed, 87 insertions(+)
>  create mode 100755 t/t2060-switch.sh
> 
> diff --git a/t/t2060-switch.sh b/t/t2060-switch.sh
> new file mode 100755
> index 0000000000..1e1e834c1b
> --- /dev/null
> +++ b/t/t2060-switch.sh
> @@ -0,0 +1,87 @@
> +#!/bin/sh
> +

[snip]

> +
> +test_expect_success 'switching ignores file of same branch name' '
> +     test_when_finished git switch master &&
> +     : >first-branch &&
> +     git switch first-branch &&
> +     echo refs/heads/first-branch >expected &&
> +     git symbolic-ref HEAD >actual &&
> +     test_commit expected actual

s/commit/cmp/

> +'
> +
> +test_expect_success 'guess and create branch ' '
> +     test_when_finished git switch master &&
> +     test_must_fail git switch foo &&
> +     git switch --guess foo &&
> +     echo refs/heads/foo >expected &&
> +     git symbolic-ref HEAD >actual &&
> +     test_cmp expected actual
> +'
> +
> +test_done
> 

Reply via email to