mirror of
https://github.com/lloeki/dotfiles.git
synced 2025-12-06 07:24:39 +01:00
optimizations
This commit is contained in:
parent
47e4887d9d
commit
295a5832f7
1 changed files with 3 additions and 3 deletions
|
|
@ -100,7 +100,7 @@ __git_ps1_vars() {
|
||||||
[[ $gitdir -eq 0 && "true" = "$(git rev-parse --is-inside-work-tree 2>/dev/null)" ]] && work=1
|
[[ $gitdir -eq 0 && "true" = "$(git rev-parse --is-inside-work-tree 2>/dev/null)" ]] && work=1
|
||||||
|
|
||||||
# gitdir corner case
|
# gitdir corner case
|
||||||
[[ "$g" == '.' ]] && if [[ "$(basename "$PWD")" == ".git" ]]; then
|
[[ "$g" == '.' ]] && if [[ "${PWD##*/}" == ".git" ]]; then
|
||||||
# inside .git: not a bare repository!
|
# inside .git: not a bare repository!
|
||||||
# weird: --is-bare-repository returns true regardless
|
# weird: --is-bare-repository returns true regardless
|
||||||
bare=0
|
bare=0
|
||||||
|
|
@ -159,7 +159,7 @@ __git_ps1_vars() {
|
||||||
|
|
||||||
## untracked files
|
## untracked files
|
||||||
if [[ -n "${GIT_PS1_SHOWUNTRACKEDFILES-}" ]]; then
|
if [[ -n "${GIT_PS1_SHOWUNTRACKEDFILES-}" ]]; then
|
||||||
[ -n "$(git ls-files --others --exclude-standard)" ] && untracked=1
|
[[ -n "$(git ls-files --others --exclude-standard)" ]] && untracked=1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
@ -181,7 +181,7 @@ __git_ps1_vars() {
|
||||||
GIT_PS1_BRANCH="$branch"
|
GIT_PS1_BRANCH="$branch"
|
||||||
GIT_PS1_SUBJECT="$subject"
|
GIT_PS1_SUBJECT="$subject"
|
||||||
GIT_PS1_TOPLEVEL="$toplevel"
|
GIT_PS1_TOPLEVEL="$toplevel"
|
||||||
GIT_PS1_NAME="$(basename "$toplevel")"
|
GIT_PS1_NAME="${toplevel##*/}"
|
||||||
GIT_PS1_PREFIX="$prefix"
|
GIT_PS1_PREFIX="$prefix"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue