mirror of
https://github.com/ohmybash/oh-my-bash.git
synced 2024-05-11 05:55:37 +00:00
omb-prompt-base: Add "." to git branch whitelist (#420)
* omb-prompt-base: Add "." to git branch whitelist Add "." to git branch character whitelist to fix branches like v6.0 or 5.4.2, as examples. * Update lib/omb-prompt-base.sh Co-authored-by: Koichi Murase <myoga.murase@gmail.com>
This commit is contained in:
@@ -170,7 +170,8 @@ function scm_prompt_info_common {
|
||||
function git_clean_branch {
|
||||
local unsafe_ref=$(command git symbolic-ref -q HEAD 2> /dev/null)
|
||||
local stripped_ref=${unsafe_ref##refs/heads/}
|
||||
local clean_ref=${stripped_ref//[^a-zA-Z0-9\/_]/-}
|
||||
local clean_ref=${stripped_ref//[\$\`\\]/-}
|
||||
clean_ref=${clean_ref//[^[:print:]]/-} # strip escape sequences, etc.
|
||||
echo $clean_ref
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user