Fix regexp with space for compatibility

pull/210/head
Travis A. Everett 5 years ago committed by GitHub
parent 550a6b4340
commit 9132b6dec9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -1318,7 +1318,8 @@ function is_valid_branch_name() {
# * "~", "^", ":", "\", space
# * end with a "/"
# * end with ".lock"
[[ "$1" =~ (\/\.|\.\.|[~^:\\ ]|\/$|\.lock$) ]] && return 1
pattern='(\/\.|\.\.|[~^:\\ ]|\/$|\.lock$)'
[[ "$1" =~ $pattern ]] && return 1
return 0
}

Loading…
Cancel
Save