From 7df89566f389e5a1e7df85f7b6584a105ec3072c Mon Sep 17 00:00:00 2001 From: Kevin Ballard Date: Tue, 29 Jan 2013 12:59:34 -0800 Subject: Fix __fish_git_prompt's upstream indicator for git-svn branches --- share/functions/__fish_git_prompt.fish | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'share/functions/__fish_git_prompt.fish') diff --git a/share/functions/__fish_git_prompt.fish b/share/functions/__fish_git_prompt.fish index 52579cee..0e226b01 100644 --- a/share/functions/__fish_git_prompt.fish +++ b/share/functions/__fish_git_prompt.fish @@ -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) if test (count $svn_upstream) -ne 0 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 for i in (seq (count $svn_remote)) 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 end else - if test (echo $svn_upstream | cut -c 1) = / - set upstream (echo $svn_upstream | cut -c 2-) - else - set upstream $svn_upstream - end + set upstream (/bin/sh -c 'val=${1#/branches}; echo "${val#/}"' -- $svn_upstream) set -l fetch_val (git config "$cur_prefix".fetch) if test -n "$fetch_val" set -l IFS : -- cgit v1.2.3