mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-01-30 02:44:42 +01:00
Add git_get_root function which returns root of current repo
This commit is contained in:
parent
b6ea876971
commit
4c91a70947
1 changed files with 4 additions and 0 deletions
|
|
@ -5,6 +5,10 @@ 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"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# returns root of current repo
|
||||||
|
function git_get_root() {
|
||||||
|
echo "$(git rev-parse --show-toplevel 2> /dev/null)"
|
||||||
|
}
|
||||||
|
|
||||||
# Checks if working tree is dirty
|
# Checks if working tree is dirty
|
||||||
parse_git_dirty() {
|
parse_git_dirty() {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue