Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Cleanly return in case of not in a git repository tree.

  • Loading branch information...
commit b5d6f5af2c160c4f4df4b6137581fa8cc23296f7 1 parent d5872bc
@wayneeseguin authored
Showing with 2 additions and 3 deletions.
  1. +2 −3 contrib/ps1_functions
View
5 contrib/ps1_functions
@@ -51,9 +51,8 @@ ps1_git()
return 0
}
- branch=$(git symbolic-ref -q HEAD 2>/dev/null)
-
- (( $? > 0 )) && return 0 # Not in a git repo, no need to continue.
+ branch=$(git symbolic-ref -q HEAD 2>/dev/null) ||
+ && return 0 # Not in a git repo, no need to continue.
branch=${branch##refs/heads/}
Please sign in to comment.
Something went wrong with that request. Please try again.