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