preserve-cwd

This commit is contained in:
Thomas Forgione 2024-12-17 16:41:46 +01:00
parent d03b5e7e25
commit facaccc381
1 changed files with 2 additions and 2 deletions

View File

@ -79,14 +79,14 @@ fi
git_prompt_info_no_space() { git_prompt_info_no_space() {
current="$PWD" current="$PWD"
while [ "$PWD" != "/" ] && [ ! -d "$PWD/.git" ]; do while [ "$PWD" != "/" ] && [ ! -d "$PWD/.git" ]; do
cd .. builtin cd ..
done done
if [ -f "$PWD/.gitskipprompt" ]; then if [ -f "$PWD/.gitskipprompt" ]; then
return return
fi fi
cd "$current" builtin cd "$current"
local info=$(git_prompt_info) local info=$(git_prompt_info)
if [ ! -z $info ]; then if [ ! -z $info ]; then
echo " $info" echo " $info"