mirror of
https://github.com/lloeki/dotfiles.git
synced 2025-12-06 07:24:39 +01:00
lazier git info
This commit is contained in:
parent
94be104bc9
commit
b6c2437ed3
4 changed files with 20 additions and 5 deletions
|
|
@ -50,11 +50,21 @@ __git_ps1_branch() {
|
|||
echo ${branch##refs/heads/}
|
||||
}
|
||||
|
||||
# compute git status and set environment variables
|
||||
__git_ps1_vars() {
|
||||
__git_ps1_gitdir() {
|
||||
local g="$(__gitdir)"
|
||||
|
||||
# are we in a git repo?
|
||||
if [[ -z "$g" ]]; then
|
||||
unset GIT_PS1_GITDIR
|
||||
else
|
||||
GIT_PS1_GITDIR="$g"
|
||||
fi
|
||||
}
|
||||
|
||||
# compute git status and set environment variables
|
||||
__git_ps1_vars() {
|
||||
local g="$GIT_PS1_GITDIR"
|
||||
|
||||
if [[ -z "$g" ]]; then
|
||||
unset GIT_PS1_STATUS
|
||||
unset GIT_PS1_BRANCH
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue