worktree add: add --lock option
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Wed, 12 Apr 2017 13:58:05 +0000 (20:58 +0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 21 Apr 2017 00:59:02 +0000 (17:59 -0700)
As explained in the document. This option has an advantage over the
command sequence "git worktree add && git worktree lock": there will be
no gap that somebody can accidentally "prune" the new worktree (or soon,
explicitly "worktree remove" it).

"worktree add" does keep a lock on while it's preparing the worktree.
If --lock is specified, this lock remains after the worktree is created.

Suggested-by: David Taylor <David.Taylor@dell.com>
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Helped-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
No differences found