git: slash-friendly strip of branch name

Review Request #1522 — Created April 21, 2010 and submitted — Latest diff uploaded

Information

RBTools
master

Reviewers

git branch names can contains slashes, so stripping of everything up to the last slash can break tracking branch detection. This patch introduces a bit friendlier re.sub(r'^refs/heads/', '', ...)

This change can be also pulled from github: http://github.com/che0/rbtools/tree/branches-with-slashes2
I developed a test case to pass with branch "mybranch", for which it passed. Switching test branch name to "my/branch" made it fail. Second commit which introduces slash-friendly stripping method makes it pass again.
    Loading...