mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-02-13 03:01:32 +01:00
Unifies function declarations.
This commit is contained in:
parent
adc756f4e3
commit
830575e319
1 changed files with 5 additions and 5 deletions
10
lib/git.zsh
10
lib/git.zsh
|
|
@ -22,13 +22,13 @@ git_is_clean() {
|
||||||
}
|
}
|
||||||
|
|
||||||
# Formats prompt string for current git commit short SHA
|
# Formats prompt string for current git commit short SHA
|
||||||
function git_prompt_short_sha() {
|
git_prompt_short_sha() {
|
||||||
SHA=$(command git rev-parse --short HEAD 2> /dev/null) && \
|
SHA=$(command git rev-parse --short HEAD 2> /dev/null) && \
|
||||||
echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER"
|
echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER"
|
||||||
}
|
}
|
||||||
|
|
||||||
# Formats prompt string for current git commit long SHA
|
# Formats prompt string for current git commit long SHA
|
||||||
function git_prompt_long_sha() {
|
git_prompt_long_sha() {
|
||||||
SHA=$(command git rev-parse HEAD 2> /dev/null) && \
|
SHA=$(command git rev-parse HEAD 2> /dev/null) && \
|
||||||
echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER"
|
echo "$ZSH_THEME_GIT_PROMPT_SHA_BEFORE$SHA$ZSH_THEME_GIT_PROMPT_SHA_AFTER"
|
||||||
}
|
}
|
||||||
|
|
@ -91,7 +91,7 @@ git_prompt_status() {
|
||||||
#compare the provided version of git to the version installed and on path
|
#compare the provided version of git to the version installed and on path
|
||||||
#prints 1 if installed version > input version
|
#prints 1 if installed version > input version
|
||||||
#prints -1 otherwise
|
#prints -1 otherwise
|
||||||
function is_recent_git_version() {
|
is_recent_git_version() {
|
||||||
local not_recent_git
|
local not_recent_git
|
||||||
local installed_git
|
local installed_git
|
||||||
not_recent_git=(1 7 2);
|
not_recent_git=(1 7 2);
|
||||||
|
|
@ -106,7 +106,7 @@ function is_recent_git_version() {
|
||||||
return 1
|
return 1
|
||||||
}
|
}
|
||||||
|
|
||||||
function set_git_status_options() {
|
set_git_status_options() {
|
||||||
GIT_STATUS_OPTIONS=''
|
GIT_STATUS_OPTIONS=''
|
||||||
if is_recent_git_version; then
|
if is_recent_git_version; then
|
||||||
GIT_STATUS_OPTIONS+='--ignore-submodules=dirty'
|
GIT_STATUS_OPTIONS+='--ignore-submodules=dirty'
|
||||||
|
|
@ -116,7 +116,7 @@ function set_git_status_options() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
function check_git_show_status() {
|
check_git_show_status() {
|
||||||
if [[ $(command git config --get oh-my-zsh.hide-status) != "1" ]]; then
|
if [[ $(command git config --get oh-my-zsh.hide-status) != "1" ]]; then
|
||||||
# no need to set options if status is hidden anyway
|
# no need to set options if status is hidden anyway
|
||||||
set_git_status_options
|
set_git_status_options
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue