Skip to content

Commit f59849f

Browse files
committed
Fail silently, when listing, if the user is not in a git repo
1 parent d127846 commit f59849f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

wt

+3-1
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,9 @@ arg=$(echo "${args[0]}" | sed 's/\//\\\//g')
1717

1818
# show worktree list
1919
worktree_list() {
20-
git worktree list
20+
if git rev-parse --git-dir &> /dev/null; then
21+
git worktree list
22+
fi
2123
}
2224

2325
help_message() {

0 commit comments

Comments
 (0)