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

2018-09-29 Thread Duy Nguyen
On Sun, Sep 23, 2018 at 04:41:32AM -0400, Eric Sunshine wrote:
> > +   grep "main/HEAD: detached HEAD points" out
> 
> This message doesn't get localized, so no need for
> test_i18ngrep(). Okay.

Don't remind me. I started to mark all strings in fsck for translation
and faced the reality that I would need to change a lot to
test_i18ngrep :(
--
Duy


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

2018-09-23 Thread Eric Sunshine
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.

> +'