From b65df78a10c3bcc40d18f3e926bb5a49821acc31 Mon Sep 17 00:00:00 2001 From: Michael Trier Date: Tue, 16 Dec 2008 09:55:00 -0500 Subject: Fixed a bug with branch names omitting path components. Git allows branches to be named and organized using path components, e.g using a branch called "refactoring/feature1", which gets stored under refs/heads/refactoring/feature1. The previous code omitted everything but the last path component giving the name "feature1" instead of "refactoring/feature1" for the branch. This changeset fixes that. (cherry picked from commit dc4738bc53e580754e47037e26c7eec3047aeb69) --- lib/git/head.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/git/head.py') diff --git a/lib/git/head.py b/lib/git/head.py index 4386aa98..c56bb1fa 100644 --- a/lib/git/head.py +++ b/lib/git/head.py @@ -104,7 +104,12 @@ class Head(object): git.Head """ full_name, ids = line.split("\x00") - name = full_name.split("/")[-1] + + if full_name.startswith('refs/heads/'): + name = full_name[len('refs/heads/'):] + else: + name = full_name + c = commit.Commit(repo, id=ids) return Head(name, c) -- cgit v1.2.1