+
Skip to content

Cater for cases where upstream path is one level lower than the root SVN... #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion contrib/completion/git-completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ __git_ps1_show_upstream ()
{
local key value
local svn_remote svn_url_pattern count n
local upstream=git legacy="" verbose=""
local upstream=git upstream_path="" legacy="" verbose=""

svn_remote=()
# get some config options from git-config
Expand Down Expand Up @@ -142,9 +142,18 @@ __git_ps1_show_upstream ()
svn_upstream=${svn_upstream#${svn_remote[$n]}}
done

upstream_path="$(
expr "$svn_upstream" : ".*/\(tags/.*\)"
)$(
expr "$svn_upstream" : ".*branches/\(.*\)"
)$(
expr "$svn_upstream" : ".*/\(trunk\)"
)"
if [[ -z "$svn_upstream" ]]; then
# default branch name for checkouts with no layout:
upstream=${GIT_SVN_ID:-git-svn}
elif [[ -n "$upstream_path" ]]; then
upstream=$upstream_path
else
upstream=${svn_upstream#/}
fi
Expand Down
点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载