Skip to content

Commit 16ebba4

Browse files
author
Jonathan Dahan
committed
simplify grep fallback
1 parent 85b03f7 commit 16ebba4

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

functions/geometry_git.zsh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -82,11 +82,9 @@ geometry_git_conflicts() {
8282

8383
pushd -q $(git rev-parse --show-toplevel)
8484

85-
_grep="grep"
86-
(($+commands[ag])) && _grep="ag"
87-
(($+commands[rg])) && _grep="rg"
85+
_grep=${GEOMETRY_GIT_GREP:=${commands[rg]:=${commands[ag]:=${commands[grep]}}}}
8886

89-
conflict_list=$(${GEOMETRY_GIT_GREP:-$_grep} -cH '^=======$' $conflicts)
87+
conflict_list=$($_grep -cH '^=======$' $conflicts)
9088
popd -q
9189

9290
raw_file_count="${#${(@f)conflict_list}}"

0 commit comments

Comments
 (0)