mirror of
https://github.com/lloeki/dotfiles.git
synced 2025-12-06 07:24:39 +01:00
fewer forks, more speed
This commit is contained in:
parent
904ff11aa9
commit
5777fbff70
1 changed files with 2 additions and 2 deletions
|
|
@ -117,7 +117,7 @@ __git_ps1_vars() {
|
||||||
|
|
||||||
# find base dir (toplevel)
|
# find base dir (toplevel)
|
||||||
[[ $bare -eq 1 ]] && toplevel="$g"
|
[[ $bare -eq 1 ]] && toplevel="$g"
|
||||||
[[ $bare -eq 0 ]] && toplevel="$(dirname $g)"
|
[[ $bare -eq 0 ]] && toplevel="${g%/*}"
|
||||||
|
|
||||||
# find relative path within toplevel
|
# find relative path within toplevel
|
||||||
prefix="${PWD/#$toplevel/}"
|
prefix="${PWD/#$toplevel/}"
|
||||||
|
|
@ -139,7 +139,7 @@ __git_ps1_vars() {
|
||||||
# working directory status
|
# working directory status
|
||||||
if [[ $work -eq 1 ]]; then
|
if [[ $work -eq 1 ]]; then
|
||||||
## dirtiness, if config allows it
|
## dirtiness, if config allows it
|
||||||
if [[ -n "${GIT_PS1_SHOWDIRTYSTATE-}" && "$(git config --bool bash.showDirtyState)" != "false" ]]; then
|
if [[ -n "${GIT_PS1_SHOWDIRTYSTATE-}" ]]; then
|
||||||
# unstaged files
|
# unstaged files
|
||||||
git diff --no-ext-diff --ignore-submodules --quiet --exit-code || unstaged=1
|
git diff --no-ext-diff --ignore-submodules --quiet --exit-code || unstaged=1
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue