fish: fix errors with prompt when cwd does not exist
This commit is contained in:
parent
6397ca360f
commit
1026262031
|
@ -51,7 +51,12 @@ function fish_git_prompt
|
|||
command -qs git
|
||||
or return
|
||||
|
||||
pushd (string replace -r '/\.git(/.*)?$' '' "$PWD")
|
||||
set -l here (string replace -r '/\.git(/.*)?$' '' "$PWD")
|
||||
|
||||
test -d "$here"
|
||||
or return
|
||||
|
||||
pushd "$here"
|
||||
|
||||
############################################################
|
||||
# Check if in a git repo and save branch and status
|
||||
|
|
Reference in New Issue