mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-09 02:24:03 +01:00
Call current_branch() only once by using the cached value.
This commit is contained in:
parent
397c085a19
commit
3f5b496125
2 changed files with 2 additions and 2 deletions
|
|
@ -16,7 +16,7 @@ ZSH_THEME_GIT_PROMPT_CLEAN=""
|
||||||
git_custom_status() {
|
git_custom_status() {
|
||||||
local cb=$(current_branch)
|
local cb=$(current_branch)
|
||||||
if [ -n "$cb" ]; then
|
if [ -n "$cb" ]; then
|
||||||
echo "$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_PREFIX$(current_branch)$ZSH_THEME_GIT_PROMPT_SUFFIX"
|
echo "$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_PREFIX$cb$ZSH_THEME_GIT_PROMPT_SUFFIX"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@ ZSH_THEME_GIT_PROMPT_CLEAN=""
|
||||||
git_custom_status() {
|
git_custom_status() {
|
||||||
local cb=$(current_branch)
|
local cb=$(current_branch)
|
||||||
if [ -n "$cb" ]; then
|
if [ -n "$cb" ]; then
|
||||||
echo "$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_PREFIX$(current_branch)$ZSH_THEME_GIT_PROMPT_SUFFIX"
|
echo "$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_PREFIX$cb$ZSH_THEME_GIT_PROMPT_SUFFIX"
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue