Re: [PATCH 7/8] fsck: check HEAD and reflog from other worktrees
- From
Eric Sunshine <sunshine@sunshineco.com>
- Date
- Sep 23, 2018, 08:41 UTC
- Message-ID
- <CAPig+cTcaS-J5CwNo5RqeZiJYQ9OTt+Qzo08tdDjvZNaVSK2OQ@mail.gmail.com>
- In-Reply-To
- <20180922180500.4689-8-pclouds@gmail.com>
On Sat, Sep 22, 2018 at 2:05 PM Nguyễn Thái Ngọc Duy <pclouds@gmail.com> wrote:
Show 15 quoted lines
> fsck is a repo-wide operation and should check all references no > matter which worktree they are associated to. > > Reported-by: Jeff King <peff@peff.net> > Helped-by: Elijah Newren <newren@gmail.com> > Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@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.
> +'