Skip to content

Commit 3b08f89

Browse files
committed
grep-rank: fix empty results case
1 parent ae7c501 commit 3b08f89

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

git-grep-rank

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ if [[ "$1" == '-v' ]]; then
66
fi
77

88
matches=$(git grep -n $1 | grep -v '^Binary file')
9-
count=$(wc -l <<< "$matches" | tr -d ' ')
9+
count=$(echo -n "$matches" | wc -l | tr -d ' ')
1010

1111
echo "$count matches for '$1'"
1212

0 commit comments

Comments
 (0)