Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion functions/geometry_git
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,17 @@ geometry_git_conflicts() {
local conflicts conflict_list
local file_count
local total raw_total
local git_root
conflicts=$(git diff --name-only --diff-filter=U -z 2>/dev/null)

[[ -z "$conflicts" ]] && return


_grep=${GEOMETRY_GIT_GREP:=${commands[rg]:=${commands[ag]:=${commands[grep]}}}}
conflict_list=$($_grep -cH '^=======$' ${(0)conflicts})

git_root=$(git rev-parse --show-toplevel)

conflict_list=$($_grep -cH '^=======$' ${git_root/$^conflicts})
Comment on lines +76 to +78
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this expansion feels fragile, not sure of best practice here


file_count="${(w)#conflict_list}"

Expand Down