Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
github
oh-my-zsh
Commits
8e973d42
Unverified
Commit
8e973d42
authored
Jan 03, 2022
by
Marc Cornellà
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(bureau): fix `status` variable name causing error (#10561)
Also cleaned up the code a bit Fixes #10561
parent
d87ab251
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
27 deletions
+26
-27
bureau.zsh-theme
themes/bureau.zsh-theme
+26
-27
No files found.
themes/bureau.zsh-theme
View file @
8e973d42
...
@@ -24,59 +24,58 @@ bureau_git_branch () {
...
@@ -24,59 +24,58 @@ bureau_git_branch () {
}
}
bureau_git_status() {
bureau_git_status() {
local
_STATUS _INDEX
local
result gitstatus
# check status of files
# check status of files
_INDEX=$(command git status --porcelain
2> /dev/null)
gitstatus=$(command git status --porcelain -b
2> /dev/null)
if [[ -n "$
_INDEX
" ]]; then
if [[ -n "$
gitstatus
" ]]; then
if $(echo "$
_INDEX
" | command grep -q '^[AMRD]. '); then
if $(echo "$
gitstatus
" | command grep -q '^[AMRD]. '); then
_STATUS="$_STATUS
$ZSH_THEME_GIT_PROMPT_STAGED"
result+="
$ZSH_THEME_GIT_PROMPT_STAGED"
fi
fi
if $(echo "$
_INDEX
" | command grep -q '^.[MTD] '); then
if $(echo "$
gitstatus
" | command grep -q '^.[MTD] '); then
_STATUS="$_STATUS
$ZSH_THEME_GIT_PROMPT_UNSTAGED"
result+="
$ZSH_THEME_GIT_PROMPT_UNSTAGED"
fi
fi
if $(echo "$
_INDEX
" | command grep -q -E '^\?\? '); then
if $(echo "$
gitstatus
" | command grep -q -E '^\?\? '); then
_STATUS="$_STATUS
$ZSH_THEME_GIT_PROMPT_UNTRACKED"
result+="
$ZSH_THEME_GIT_PROMPT_UNTRACKED"
fi
fi
if $(echo "$
_INDEX
" | command grep -q '^UU '); then
if $(echo "$
gitstatus
" | command grep -q '^UU '); then
_STATUS="$_STATUS
$ZSH_THEME_GIT_PROMPT_UNMERGED"
result+="
$ZSH_THEME_GIT_PROMPT_UNMERGED"
fi
fi
else
else
_STATUS="$_STATUS
$ZSH_THEME_GIT_PROMPT_CLEAN"
result+="
$ZSH_THEME_GIT_PROMPT_CLEAN"
fi
fi
# check status of local repository
# check status of local repository
_INDEX=$(command git status --porcelain -b 2> /dev/null)
if $(echo "$gitstatus" | command grep -q '^## .*ahead'); then
if $(echo "$_INDEX" | command grep -q '^## .*ahead'); then
result+="$ZSH_THEME_GIT_PROMPT_AHEAD"
_STATUS="$_STATUS$ZSH_THEME_GIT_PROMPT_AHEAD"
fi
fi
if $(echo "$
_INDEX
" | command grep -q '^## .*behind'); then
if $(echo "$
gitstatus
" | command grep -q '^## .*behind'); then
_STATUS="$_STATUS
$ZSH_THEME_GIT_PROMPT_BEHIND"
result+="
$ZSH_THEME_GIT_PROMPT_BEHIND"
fi
fi
if $(echo "$
_INDEX
" | command grep -q '^## .*diverged'); then
if $(echo "$
gitstatus
" | command grep -q '^## .*diverged'); then
_STATUS="$_STATUS
$ZSH_THEME_GIT_PROMPT_DIVERGED"
result+="
$ZSH_THEME_GIT_PROMPT_DIVERGED"
fi
fi
if $(command git rev-parse --verify refs/stash &> /dev/null); then
if $(command git rev-parse --verify refs/stash &> /dev/null); then
_STATUS="$_STATUS
$ZSH_THEME_GIT_PROMPT_STASHED"
result+="
$ZSH_THEME_GIT_PROMPT_STASHED"
fi
fi
echo $
_STATUS
echo $
result
}
}
bureau_git_prompt() {
bureau_git_prompt() {
local branch=$(bureau_git_branch)
local
git
branch=$(bureau_git_branch)
local status=$(bureau_git_status)
local
git
status=$(bureau_git_status)
local info
local info
if [[ -z "$
{branch}
" ]]; then
if [[ -z "$
gitbranch
" ]]; then
return
return
fi
fi
info="${branch:gs/%/%%}"
info="${
git
branch:gs/%/%%}"
if [[ -n "$
{status}
" ]]; then
if [[ -n "$
gitstatus
" ]]; then
info+=" $status"
info+=" $
git
status"
fi
fi
echo "${ZSH_THEME_GIT_PROMPT_PREFIX}${info}${ZSH_THEME_GIT_PROMPT_SUFFIX}"
echo "${ZSH_THEME_GIT_PROMPT_PREFIX}${info}${ZSH_THEME_GIT_PROMPT_SUFFIX}"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment