]> git.ipfire.org Git - thirdparty/git.git/commit - branch.c
branch: split validate_new_branchname() into two
authorJunio C Hamano <gitster@pobox.com>
Fri, 13 Oct 2017 04:45:40 +0000 (13:45 +0900)
committerJunio C Hamano <gitster@pobox.com>
Fri, 13 Oct 2017 08:11:41 +0000 (17:11 +0900)
commitbc1c9c0e674bdd293c29ae84365915848ed01d7a
treeddde1bceda59ec50837294f152d49834aa9d6bdd
parent8280c4c1ea59bc6d101c5616490627b63934318e
branch: split validate_new_branchname() into two

Checking if a proposed name is appropriate for a branch is strictly
a subset of checking if we want to allow creating or updating a
branch with such a name.  The mysterious sounding 'attr_only'
parameter to validate_new_branchname() is used to switch the
function between these two roles.

Instead, split the function into two, and adjust the callers.  A new
helper validate_branchname() only checks the name and reports if the
branch already exists.

This loses one NEEDSWORK from the branch API.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
branch.c
branch.h
builtin/branch.c
builtin/checkout.c