mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-02 02:19:06 +01:00
Fix merge errors
This commit is contained in:
parent
7bebacbb87
commit
18e8997c39
2 changed files with 1 additions and 28 deletions
25
lib/git.zsh
25
lib/git.zsh
|
|
@ -4,28 +4,12 @@ function git_prompt_info() {
|
||||||
echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX"
|
echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX"
|
||||||
}
|
}
|
||||||
|
|
||||||
<<<<<<< HEAD
|
|
||||||
# Checks if working tree is dirty
|
# Checks if working tree is dirty
|
||||||
parse_git_dirty() {
|
parse_git_dirty() {
|
||||||
if [[ -n $(git status -s --ignore-submodules=dirty 2> /dev/null) ]]; then
|
if [[ -n $(git status -s --ignore-submodules=dirty 2> /dev/null) ]]; then
|
||||||
echo "$ZSH_THEME_GIT_PROMPT_DIRTY"
|
echo "$ZSH_THEME_GIT_PROMPT_DIRTY"
|
||||||
else
|
else
|
||||||
echo "$ZSH_THEME_GIT_PROMPT_CLEAN"
|
echo "$ZSH_THEME_GIT_PROMPT_CLEAN"
|
||||||
=======
|
|
||||||
parse_git_dirty () {
|
|
||||||
gitstat=$(git status 2>/dev/null | grep '\(# Untracked\|# Changes\|# Changed but not updated:\)')
|
|
||||||
|
|
||||||
if [[ $(echo ${gitstat} | grep -c "^# Changes to be committed:$") > 0 ]]; then
|
|
||||||
echo -n "$ZSH_THEME_GIT_PROMPT_DIRTY"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ $(echo ${gitstat} | grep -c "^\(# Untracked files:\|# Changed but not updated:\|# Changes not staged for commit:\)$") > 0 ]]; then
|
|
||||||
echo -n "$ZSH_THEME_GIT_PROMPT_UNTRACKED"
|
|
||||||
fi
|
|
||||||
|
|
||||||
if [[ $(echo ${gitstat} | grep -v '^$' | wc -l | tr -d ' ') == 0 ]]; then
|
|
||||||
echo -n "$ZSH_THEME_GIT_PROMPT_CLEAN"
|
|
||||||
>>>>>>> bd003653824bcff2231d20df783f239aff64b4b4
|
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -36,15 +20,6 @@ function git_prompt_ahead() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
#
|
|
||||||
# Will return the current branch name
|
|
||||||
# Usage example: git pull origin $(current_branch)
|
|
||||||
#
|
|
||||||
function current_branch() {
|
|
||||||
ref=$(git symbolic-ref HEAD 2> /dev/null) || return
|
|
||||||
echo ${ref#refs/heads/}
|
|
||||||
}
|
|
||||||
|
|
||||||
# Formats prompt string for current git commit short SHA
|
# Formats prompt string for current git commit short SHA
|
||||||
function git_prompt_short_sha() {
|
function git_prompt_short_sha() {
|
||||||
SHA=$(git rev-parse --short HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER"
|
SHA=$(git rev-parse --short HEAD 2> /dev/null) && echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER"
|
||||||
|
|
|
||||||
|
|
@ -51,13 +51,11 @@ for plugin ($plugins); do
|
||||||
done
|
done
|
||||||
|
|
||||||
# Load all of your custom configurations from custom/
|
# Load all of your custom configurations from custom/
|
||||||
<<<<<<< HEAD
|
|
||||||
for config_file ($ZSH_CUSTOM/*.zsh) source $config_file
|
for config_file ($ZSH_CUSTOM/*.zsh) source $config_file
|
||||||
=======
|
|
||||||
if [ -d "$ZSH/custom" ]; then
|
if [ -d "$ZSH/custom" ]; then
|
||||||
for config_file ($ZSH/custom/*.zsh) source $config_file
|
for config_file ($ZSH/custom/*.zsh) source $config_file
|
||||||
fi
|
fi
|
||||||
>>>>>>> bd003653824bcff2231d20df783f239aff64b4b4
|
|
||||||
|
|
||||||
# Load the theme
|
# Load the theme
|
||||||
if [ "$ZSH_THEME" = "random" ]
|
if [ "$ZSH_THEME" = "random" ]
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue