Prefer Fossil branch over Git branch in prompt
This commit is contained in:
parent
1c7c719fa5
commit
5b0d6744de
2 changed files with 6 additions and 6 deletions
|
@ -7,11 +7,11 @@ function fish_prompt --description 'Write out the prompt'
|
|||
set suffix '>'
|
||||
end
|
||||
|
||||
set -l branch (git symbolic-ref HEAD 2>/dev/null)
|
||||
set branch (string replace -r "^refs/heads/" "" $branch)
|
||||
set -l branch (fossil branch current 2>/dev/null)
|
||||
|
||||
if test -z "$branch"
|
||||
set branch (fossil branch current 2>/dev/null)
|
||||
set branch (git symbolic-ref HEAD 2>/dev/null)
|
||||
set branch (string replace -r "^refs/heads/" "" $branch)
|
||||
end
|
||||
|
||||
set -l vcs
|
||||
|
|
6
zshrc
6
zshrc
|
@ -103,11 +103,11 @@ set_prompt
|
|||
__precmd() {
|
||||
__update_terminal_cwd
|
||||
|
||||
local branch=$(git symbolic-ref HEAD 2>/dev/null)
|
||||
branch=${branch##refs/heads/}
|
||||
local branch=$(fossil branch current 2>/dev/null)
|
||||
|
||||
if [ -z "$branch" ]; then
|
||||
branch=$(fossil branch current 2>/dev/null)
|
||||
branch=$(git symbolic-ref HEAD 2>/dev/null)
|
||||
branch=${branch##refs/heads/}
|
||||
fi
|
||||
|
||||
set_prompt $branch
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue