On Sat, Sep 22, 2018 at 2:05 PM Nguyễn Thái Ngọc Duy <pclo...@gmail.com> wrote:
> fsck is a repo-wide operation and should check all references no
> matter which worktree they are associated to.
>
> Reported-by: Jeff King <p...@peff.net>
> Helped-by: Elijah Newren <new...@gmail.com>
> Signed-off-by: Nguyễn Thái Ngọc Duy <pclo...@gmail.com>
> ---
> diff --git a/t/t1450-fsck.sh b/t/t1450-fsck.sh
> @@ -101,6 +101,45 @@ test_expect_success 'HEAD link pointing at a funny 
> place' '
> +test_expect_success 'HEAD link pointing at a funny object (from different 
> wt)' '
> +       test_when_finished "mv .git/SAVED_HEAD .git/HEAD" &&
> +       test_when_finished "rm -rf .git/worktrees wt" &&
> +       git worktree add wt &&
> +       mv .git/HEAD .git/SAVED_HEAD &&
> +       echo 0000000000000000000000000000000000000000 >.git/HEAD &&

Perhaps use $ZERO_OID here instead of hardcoded "0..." string to play
friendly with brian's bc/hash-independent-tests (in 'next'). Same for
following test.

> +       # avoid corrupt/broken HEAD from interfering with repo discovery
> +       test_must_fail git -C wt fsck 2>out &&
> +       cat out &&

Unneeded 'cat'. Debugging cruft? Same for other tests.

> +       grep "main/HEAD: detached HEAD points" out

This message doesn't get localized, so no need for test_i18ngrep(). Okay.

> +'

Reply via email to