Commit d36538eb by Fred Smith
parent 4ee3be6a
......@@ -4,7 +4,8 @@
# Gracefully fails if not in a git repo and returns nothing.
__gitBranch() {
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
echo ${ref#refs/heads/}
branch=${ref//[^a-z0-9\/]/-}
echo ${branch#refs/heads/}
}
# Retrieves status information for git and places into predefined variables.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment