early exit if not in repo. thx @pickx. closes #32

This commit is contained in:
Paul Irish 2025-06-14 12:52:41 -07:00
parent 34af71aef0
commit d5f63cf328
No known key found for this signature in database
GPG key ID: 047F4C1E64AD96C0

View file

@ -13,6 +13,8 @@ if ! command -v fzf >/dev/null 2>&1; then
echo "Error: fzf is not installed. Please install fzf to use git-recent." >&2 echo "Error: fzf is not installed. Please install fzf to use git-recent." >&2
exit 1 exit 1
fi fi
[ "$(git rev-parse --is-inside-work-tree)" = "true" ] || exit
if [[ "$1" == "--help" ]]; then if [[ "$1" == "--help" ]]; then
echo "git-recent: Browse and checkout recently used Git branches." echo "git-recent: Browse and checkout recently used Git branches."
echo echo