better branchname checking

Since a dash is not a word character [\W] isn't doing  what you think it does. This patch uses git's own ref format check to validate the branch name.