On Mon, Nov 2, 2015 at 2:08 PM, Nguyễn Thái Ngọc Duy <pclouds@xxxxxxxxx> wrote: > $X/gitdir is created, or refreshed, in order to keep a linked worktree > from being pruned. But while git file is used as the foundation for > linked worktrees, it's used for other purposes as well and we should > not create $X/gitdir in those cases. > > Tighten the check. Only update an existing file, which is an > indication this is a linked worktree. > > Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@xxxxxxxxx> > --- > diff --git a/t/t0002-gitfile.sh b/t/t0002-gitfile.sh > @@ -99,6 +99,13 @@ test_expect_success 'check rev-list' ' > +test_expect_success '$REAL/gitdir is not created on ordinary git file' ' > + echo "gitdir: $REAL" >expected && > + test_cmp expected .git && > + git status && > + ! test -f "$REAL"/gitdir Minor: test_path_is_missing() might convey the intention a bit more clearly. > +' -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html