mirror of
https://github.com/itme-brain/bash.git
synced 2026-03-23 17:59:44 -04:00
fixed
This commit is contained in:
parent
c8d9ca529a
commit
79eb823bbb
1 changed files with 6 additions and 2 deletions
8
prompt
8
prompt
|
|
@ -123,8 +123,12 @@ _set_prompt() {
|
||||||
[ -z "$cached" ] && cached="${_dir_cache[$PWD]}"
|
[ -z "$cached" ] && cached="${_dir_cache[$PWD]}"
|
||||||
IFS='|' read -r _git_root _superproject _ <<< "$cached"
|
IFS='|' read -r _git_root _superproject _ <<< "$cached"
|
||||||
|
|
||||||
# Get branch (can change without cd)
|
# Get branch (can change without cd) - if fails, git root is gone
|
||||||
_read_branch
|
if ! _read_branch; then
|
||||||
|
unset "_dir_cache[$PWD]"
|
||||||
|
_set_prompt
|
||||||
|
return
|
||||||
|
fi
|
||||||
|
|
||||||
# Build paths using bash string ops (no readlink spawn)
|
# Build paths using bash string ops (no readlink spawn)
|
||||||
local git_curr_dir="${PWD#$_git_root}"
|
local git_curr_dir="${PWD#$_git_root}"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue