Skip to content

Commit fe73c35

Browse files
committed
fix(GIT_PROMPT_KIT_REF): no extra space for default-named push remote
1 parent 16eddd8 commit fe73c35

1 file changed

Lines changed: 9 additions & 5 deletions

File tree

git-prompt-kit.zsh

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -561,15 +561,19 @@ _git_prompt_kit_update_git() {
561561
fi
562562

563563
if (( triangular_workflow )); then
564-
if (( VCS_STATUS_PUSH_COMMITS_AHEAD || VCS_STATUS_PUSH_COMMITS_BEHIND )); then
565-
GIT_PROMPT_KIT_PUSH+="%F{$color_push_remote}"
566-
fi
567564

568565
if [[ $VCS_STATUS_PUSH_REMOTE_NAME != $GIT_PROMPT_KIT_DEFAULT_PUSH_REMOTE_NAME ]]; then
569-
GIT_PROMPT_KIT_PUSH+="$GIT_PROMPT_KIT_SYMBOL_PUSH_REMOTE$VCS_STATUS_PUSH_REMOTE_NAME"
566+
if (( VCS_STATUS_PUSH_COMMITS_AHEAD || VCS_STATUS_PUSH_COMMITS_BEHIND )); then
567+
GIT_PROMPT_KIT_PUSH+="%F{$color_push_remote}"
568+
# DUPE this `if`'s `then` and `else`
569+
GIT_PROMPT_KIT_PUSH+="$GIT_PROMPT_KIT_SYMBOL_PUSH_REMOTE$VCS_STATUS_PUSH_REMOTE_NAME"
570+
GIT_PROMPT_KIT_PUSH+="%F{$color_inactive}"
571+
else
572+
# DUPE this `if`'s `then` and `else`
573+
GIT_PROMPT_KIT_PUSH+="$GIT_PROMPT_KIT_SYMBOL_PUSH_REMOTE$VCS_STATUS_PUSH_REMOTE_NAME"
574+
fi
570575
fi
571576

572-
GIT_PROMPT_KIT_PUSH+="%F{$color_inactive}"
573577

574578
# push remote branch would go here
575579

0 commit comments

Comments
 (0)