]> git.ipfire.org Git - thirdparty/git.git/commit
worktree: teach `add` to recognize -d as shorthand for --detach
authorEric Sunshine <sunshine@sunshineco.com>
Mon, 7 Sep 2020 00:02:21 +0000 (20:02 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 7 Sep 2020 01:53:56 +0000 (18:53 -0700)
commitc670aa47dff9829360cc69174f8dd0d82f096011
tree3a64671cb69be3a3e0ff662a93cee1ff9484fbe9
parent07351d98992ba17ee9249b80f325f7f2c56a2251
worktree: teach `add` to recognize -d as shorthand for --detach

Like `git switch` and `git checkout`, `git worktree add` can check out a
branch or set up a detached HEAD. However, unlike those other commands,
`git worktree add` does not understand -d as shorthand for --detach,
which may confound users accustomed to using -d for this purpose.
Address this shortcoming by teaching `add` to recognize -d for --detach,
thus bringing it in line with the other commands.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Documentation/git-worktree.txt
builtin/worktree.c