Reputation: 3071
I need
Upvotes: 5
Views: 2179
Reputation: 46813
Using git-rev-parse
is the way to go. Just make sure you compare it appropriately with PWD
, and redirect standard error to /dev/null
:
[[ $(git rev-parse --show-toplevel 2>/dev/null) = "$PWD" ]]
Upvotes: 6