mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2024-12-19 20:29:45 +01:00
feat(agnoster): add remote-tracking status to prompt (#7209)
This commit is contained in:
parent
cc5100d1e9
commit
c189e8b40c
1 changed files with 11 additions and 0 deletions
|
@ -116,6 +116,17 @@ prompt_git() {
|
||||||
prompt_segment green $CURRENT_FG
|
prompt_segment green $CURRENT_FG
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
local ahead behind
|
||||||
|
ahead=$(git log --oneline @{upstream}.. 2>/dev/null)
|
||||||
|
behind=$(git log --oneline ..@{upstream} 2>/dev/null)
|
||||||
|
if [[ -n "$ahead" ]] && [[ -n "$behind" ]]; then
|
||||||
|
PL_BRANCH_CHAR=$'\u21c5'
|
||||||
|
elif [[ -n "$ahead" ]]; then
|
||||||
|
PL_BRANCH_CHAR=$'\u21b1'
|
||||||
|
elif [[ -n "$behind" ]]; then
|
||||||
|
PL_BRANCH_CHAR=$'\u21b0'
|
||||||
|
fi
|
||||||
|
|
||||||
if [[ -e "${repo_path}/BISECT_LOG" ]]; then
|
if [[ -e "${repo_path}/BISECT_LOG" ]]; then
|
||||||
mode=" <B>"
|
mode=" <B>"
|
||||||
elif [[ -e "${repo_path}/MERGE_HEAD" ]]; then
|
elif [[ -e "${repo_path}/MERGE_HEAD" ]]; then
|
||||||
|
|
Loading…
Reference in a new issue