chore: fix nested git repos
This commit is contained in:
@ -29,8 +29,7 @@ end
|
|||||||
|
|
||||||
# Git
|
# Git
|
||||||
function git::is_repo
|
function git::is_repo
|
||||||
test -d .git; or command git rev-parse --git-dir 2>/dev/null 2>/dev/null
|
test -d .git; or command git rev-parse --git-dir >/dev/null 2>/dev/null
|
||||||
# test 0 -eq 1
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function git::ahead -a ahead behind diverged none
|
function git::ahead -a ahead behind diverged none
|
||||||
@ -89,22 +88,21 @@ end
|
|||||||
|
|
||||||
function fish_right_prompt
|
function fish_right_prompt
|
||||||
|
|
||||||
if test "$theme_complete_path" = "yes"
|
# if test "$theme_complete_path" = "yes"
|
||||||
set cwd (prompt_pwd)
|
# set cwd (prompt_pwd)
|
||||||
else
|
# else
|
||||||
set cwd (basename (prompt_pwd))
|
# set cwd (basename (prompt_pwd))
|
||||||
|
|
||||||
if git::is_repo
|
# if git::is_repo
|
||||||
set root_folder (command git rev-parse --show-toplevel 2>/dev/null)
|
# set root_folder (command git rev-parse --show-toplevel 2>/dev/null)
|
||||||
set parent_root_folder (dirname $root_folder)
|
# set parent_root_folder (dirname $root_folder)
|
||||||
set cwd (echo $PWD | sed -e "s|$parent_root_folder/||")
|
# set cwd (echo $PWD | sed -e "s|$parent_root_folder/||")
|
||||||
end
|
# end
|
||||||
end
|
# end
|
||||||
|
|
||||||
# Because of having a two line promt now we dont need right anymore so we dont print anything here atm
|
# Because of having a two line promt now we dont need right anymore so we dont print anything here atm
|
||||||
#printf (yellow)"("(off)$cwd(yellow)") "(off)
|
#printf (yellow)"("(off)$cwd(yellow)") "(off)
|
||||||
#printf (off)(date +%H(yellow):(off)%M(yellow):(off)%S)(off)"\n"
|
#printf (off)(date +%H(yellow):(off)%M(yellow):(off)%S)(off)"\n"
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user