Skip to content

Commit

Permalink
Fix "stray \" error message from grep
Browse files Browse the repository at this point in the history
  • Loading branch information
joeytwiddle committed Mar 24, 2023
1 parent b8dbc21 commit 8f0be1e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion prompt.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ find_git_branch() {
# If it a remote branch, show that (this can also produce tags/...)
branch=$(git name-rev --name-only HEAD | sed 's+^remotes/++')
# But name-rev will also return if it is a few steps back from a remote branch, which sucks, so don't display that
if [[ "$branch" == "undefined" ]] || grep '\~' <<< "$branch" >/dev/null; then
if [[ "$branch" == "undefined" ]] || grep '[~]' <<< "$branch" >/dev/null; then
#branch='<detached>'
# Or show the short hash
branch='#'$(git rev-parse --short HEAD 2> /dev/null)
Expand Down

0 comments on commit 8f0be1e

Please sign in to comment.