refactor(fossil): use `fossil branch current` supported since v2.7 (#11138)
Using the automation-friendly "fossil branch current" feature added in
Fossil 2.7 instead of ad hoc parsing of human-readable "fossil branch"
output. Not only does this fix a stray space in the output, it's more
robust against changes in command output in general.
Closes #11138
Diff
1diff --git a/plugins/fossil/fossil.plugin.zsh b/plugins/fossil/fossil.plugin.zsh
2index a2123f415644c8eb51d641729213998defab2147..fadf6095d7604bdb9c08876645371b8981b83cea 100644
3--- a/plugins/fossil/fossil.plugin.zsh
4+++ b/plugins/fossil/fossil.plugin.zsh
5@@ -13,12 +13,11 @@ ZSH_THEME_FOSSIL_PROMPT_DIRTY=" %{$fg_bold[red]%}✖"
6 ZSH_THEME_FOSSIL_PROMPT_CLEAN=" %{$fg_bold[green]%}✔"
7 8 function fossil_prompt_info() {
9- local info=$(fossil branch 2>&1)
10+ local branch=$(fossil branch current 2>&1)
1112 # if we're not in a fossil repo, don't show anything
13- ! command grep -q "use --repo" <<< "$info" || return
14+ ! command grep -q "use --repo" <<< "$branch" || return
1516- local branch=$(echo $info | grep "* " | sed 's/* //g')
17 local changes=$(fossil changes)
18 local dirty="$ZSH_THEME_FOSSIL_PROMPT_CLEAN"
19