worktree: factor out dwim_branch function
authorThomas Gummerer <t.gummerer@gmail.com>
Tue, 24 Apr 2018 21:56:34 +0000 (22:56 +0100)
committerJunio C Hamano <gitster@pobox.com>
Mon, 30 Apr 2018 00:06:34 +0000 (09:06 +0900)
commit6427f87186e53d9d4319d43e4efbe46bb93b7440
tree432fe08364b7f22980e05bc0e243b499236edecd
parent2c27002a0aaab03ab850244c66d116109e7d2b83
worktree: factor out dwim_branch function

Factor out a dwim_branch function, which takes care of the dwim'ery in
'git worktree add <path>'.  It's not too much code currently, but we're
adding a new kind of dwim in a subsequent patch, at which point it makes
more sense to have it as a separate function.

Factor it out now to reduce the patch noise in the next patch.

Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
Reviewed-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/worktree.c