Re: [PATCH 7/8] fsck: check HEAD and reflog from other worktrees

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

 



On Sat, Sep 22, 2018 at 2:05 PM Nguyễn Thái Ngọc Duy <pclouds@xxxxxxxxx> wrote:
> fsck is a repo-wide operation and should check all references no
> matter which worktree they are associated to.
>
> Reported-by: Jeff King <peff@xxxxxxxx>
> Helped-by: Elijah Newren <newren@xxxxxxxxx>
> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@xxxxxxxxx>
> ---
> 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.

> +'



[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]

  Powered by Linux