mirror of
https://github.com/fish-shell/fish-shell.git
synced 2025-03-03 04:05:25 +08:00
Fix __fish_git_prompt's upstream indicator for git-svn branches
This commit is contained in:
parent
32b2c9fc9e
commit
7df89566f3
@ -124,7 +124,7 @@ function __fish_git_prompt_show_upstream --description "Helper function for __fi
|
|||||||
set -l svn_upstream (git log --first-parent -1 --grep="^git-svn-id: \($svn_url_pattern\)" ^/dev/null)
|
set -l svn_upstream (git log --first-parent -1 --grep="^git-svn-id: \($svn_url_pattern\)" ^/dev/null)
|
||||||
if test (count $svn_upstream) -ne 0
|
if test (count $svn_upstream) -ne 0
|
||||||
echo $svn_upstream[-1] | read -l _ svn_upstream _
|
echo $svn_upstream[-1] | read -l _ svn_upstream _
|
||||||
set svn_upstream (echo $svn_upstream | sed 's/@.*//')
|
set svn_upstream (/bin/sh -c 'echo "${1%@*}"' -- $svn_upstream)
|
||||||
set -l cur_prefix
|
set -l cur_prefix
|
||||||
for i in (seq (count $svn_remote))
|
for i in (seq (count $svn_remote))
|
||||||
set -l remote $svn_remote[$i]
|
set -l remote $svn_remote[$i]
|
||||||
@ -145,11 +145,7 @@ function __fish_git_prompt_show_upstream --description "Helper function for __fi
|
|||||||
set upstream git-svn
|
set upstream git-svn
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
if test (echo $svn_upstream | cut -c 1) = /
|
set upstream (/bin/sh -c 'val=${1#/branches}; echo "${val#/}"' -- $svn_upstream)
|
||||||
set upstream (echo $svn_upstream | cut -c 2-)
|
|
||||||
else
|
|
||||||
set upstream $svn_upstream
|
|
||||||
end
|
|
||||||
set -l fetch_val (git config "$cur_prefix".fetch)
|
set -l fetch_val (git config "$cur_prefix".fetch)
|
||||||
if test -n "$fetch_val"
|
if test -n "$fetch_val"
|
||||||
set -l IFS :
|
set -l IFS :
|
||||||
|
Loading…
x
Reference in New Issue
Block a user