Closed mob5566 closed 6 years ago
According to the POSIX Shell specification, ${branch##*/}
will remove the largest prefix pattern matching */
.
I'm guessing that removing the smallest prefix pattern would suit your needs better, the pattern for that being ${branch#*/}
. Have you tried this? If it works for you, maybe submit a pull request?
Hi @tysonclugg, thank you for your response!
I think the original pattern is correct for the normal condition.
If the result of git symbolic-ref --quiet HEAD
is refs/heads/master
, that works correctly.
But if I have a branch named test/dev
, that would be refs/heads/test/dev
and only dev
was showed.
I think that slash is inappropriate for being a delimiter in the branch name.
Therefore, I decide to close this issue.
Thank you all.
If there is '/' contain in git branch name, vcs_branch will show only the parts of brach name after last '/'. I think the root cause is using
branch=${branch##*/}
inpromptline#slices#vcs_branch#function_body
. Would you fix this condition?