Skip to content
This repository
Browse code

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

  • Loading branch information...
commit b5d6f5af2c160c4f4df4b6137581fa8cc23296f7 1 parent d5872bc
Wayne E. Seguin authored

Showing 1 changed file with 2 additions and 3 deletions. Show diff stats Hide diff stats

  1. +2 3 contrib/ps1_functions
5 contrib/ps1_functions
@@ -51,9 +51,8 @@ ps1_git()
51 51 return 0
52 52 }
53 53
54   - branch=$(git symbolic-ref -q HEAD 2>/dev/null)
55   -
56   - (( $? > 0 )) && return 0 # Not in a git repo, no need to continue.
  54 + branch=$(git symbolic-ref -q HEAD 2>/dev/null) ||
  55 + && return 0 # Not in a git repo, no need to continue.
57 56
58 57 branch=${branch##refs/heads/}
59 58

0 comments on commit b5d6f5a

Please sign in to comment.
Something went wrong with that request. Please try again.