From 0df602b6c08732af56698d9eef4bb1fc9802a76b Mon Sep 17 00:00:00 2001 From: Jim Boulter Date: Sun, 6 Mar 2022 13:23:55 -0800 Subject: [PATCH] Allow users to set a dirty-branch format --- modules/git/functions/git-info | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/git/functions/git-info b/modules/git/functions/git-info index 07f261d..eca5046 100644 --- a/modules/git/functions/git-info +++ b/modules/git/functions/git-info @@ -417,6 +417,11 @@ function git-info { if (( dirty > 0 )); then zstyle -s ':prezto:module:git:info:dirty' format 'dirty_format' zformat -f dirty_formatted "$dirty_format" "D:$dirty" + # Overwrite branch format to use dirty-branch format + zstyle -s ':prezto:module:git:info:dirty-branch' format 'branch_format' + if [[ -n "$branch" && -n "$branch_format" ]]; then + zformat -f branch_formatted "$branch_format" "b:$branch" + fi else zstyle -s ':prezto:module:git:info:clean' format 'clean_formatted' fi