Add git_get_root function which returns root of current repo

This commit is contained in:
Pavel Puchkin 2012-06-22 20:50:08 +11:00
commit ee14d5fa59

View file

@ -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() {