builtin/branch: consolidate action-picking logic in cmd_branch()
Consolidate the logic for deciding when to create a new branch in
cmd_branch(), and save the result for reuse. Besides making the function
more explicit, this allows us to validate options that can only be used
when creating a branch. Such an option does not exist yet, but one will
be introduced in a subsequent commit.
Helped-by: Jonathan Tan <redacted> Signed-off-by: Glen Choo <redacted> Reviewed-by: Jonathan Tan <redacted> Signed-off-by: Junio C Hamano <redacted>