mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-02 02:19:06 +01:00
Add git_get_root function which returns root of current repo
This commit is contained in:
parent
e8d582aba9
commit
ee14d5fa59
1 changed files with 5 additions and 1 deletions
|
|
@ -4,6 +4,10 @@ function git_prompt_info() {
|
|||
echo "$ZSH_THEME_GIT_PROMPT_PREFIX${ref#refs/heads/}$(parse_git_dirty)$ZSH_THEME_GIT_PROMPT_SUFFIX"
|
||||
}
|
||||
|
||||
# returns root of current repo
|
||||
function git_get_root() {
|
||||
echo "$(git rev-parse --show-toplevel 2> /dev/null)"
|
||||
}
|
||||
|
||||
# Checks if working tree is dirty
|
||||
parse_git_dirty() {
|
||||
|
|
@ -71,7 +75,7 @@ git_prompt_status() {
|
|||
|
||||
#compare the provided version of git to the version installed and on path
|
||||
#prints 1 if input version <= installed version
|
||||
#prints -1 otherwise
|
||||
#prints -1 otherwise
|
||||
function git_compare_version() {
|
||||
local INPUT_GIT_VERSION=$1;
|
||||
local INSTALLED_GIT_VERSION
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue