diff options
Diffstat (limited to 'lib/git/refs.py')
-rw-r--r-- | lib/git/refs.py | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/git/refs.py b/lib/git/refs.py index 97d0a6eb..aeee0da1 100644 --- a/lib/git/refs.py +++ b/lib/git/refs.py @@ -222,7 +222,7 @@ class SymbolicReference(object): """ fp = open(os.path.join(self.repo.path, self.name), 'r') try: - tokens = fp.readline().split(' ') + tokens = fp.readline().rstrip().split(' ') if tokens[0] != 'ref:': raise TypeError("%s is a detached symbolic reference as it points to %r" % tokens[0]) return Reference.from_path(self.repo, tokens[1]) @@ -298,10 +298,9 @@ class HEAD(SymbolicReference): raise ValueError( "Cannot reset the working tree if the index is not reset as well") # END working tree handling - repo.git.reset(mode, commit, paths, **kwargs) + self.repo.git.reset(mode, commit, paths, **kwargs) - # we always point to the active branch as it is the one changing - self + return self class Head(Reference): |