On Sun, May 22, 2016 at 6:43 AM, Nguyễn Thái Ngọc Duy <pclouds@xxxxxxxxx> wrote: > Helped-by: Eric Sunshine <sunshine@xxxxxxxxxxxxxx> > Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@xxxxxxxxx> > --- > diff --git a/Documentation/git-worktree.txt b/Documentation/git-worktree.txt > @@ -150,7 +161,8 @@ instead. > > To prevent a $GIT_DIR/worktrees entry from being pruned (which > can be useful in some situations, such as when the > -entry's working tree is stored on a portable device), add a file named > +entry's working tree is stored on a portable device), use the > +`git worktree lock` comamnd, which adds a file named s/comamnd/command/ > 'locked' to the entry's directory. The file contains the reason in > plain text. For example, if a linked working tree's `.git` file points > to `/path/main/.git/worktrees/test-next` then a file named > diff --git a/t/t2028-worktree-move.sh b/t/t2028-worktree-move.sh > @@ -0,0 +1,54 @@ > +test_expect_success 'lock linked worktree from another worktree' ' > + rm .git/worktrees/source/locked && > + git worktree add elsewhere && > + ( > + cd elsewhere && > + git worktree lock --reason hahaha ../source Could use "git -C elsewhere worktree lock ..." and drop the subshell, but not worth a re-roll. > + ) && > + echo hahaha >expected && > + test_cmp expected .git/worktrees/source/locked > +' > + > +test_expect_success 'lock worktree twice (from the locked worktree)' ' > + ( > + cd source && > + test_must_fail git worktree lock . Likewise, -C. > + ) && > + echo hahaha >expected && > + test_cmp expected .git/worktrees/source/locked > +' -- 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