Skip to content

Commit 886f7eb

Browse files
committed
Works around the fatal error when run outside a git repo folder.
1 parent 9a1a642 commit 886f7eb

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

git-currentbranch

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,5 @@ if [ "$1" = '-h' ]; then
2727
usage
2828
fi
2929

30-
#@TODO: Works, but throws a fatal error message if run in a non-git dir. We need to suppress that output.
31-
32-
git rev-parse --quiet --abbrev-ref HEAD
33-
exit $?
30+
git rev-parse --quiet --abbrev-ref HEAD 2>/dev/null
31+
exit $?

0 commit comments

Comments
 (0)