summaryrefslogtreecommitdiff
path: root/lib/git/refs.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/git/refs.py')
-rw-r--r--lib/git/refs.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/git/refs.py b/lib/git/refs.py
index cd903174..bedca7b2 100644
--- a/lib/git/refs.py
+++ b/lib/git/refs.py
@@ -112,6 +112,9 @@ class SymbolicReference(object):
# END for each packed ref
# END handle packed refs
+ if tokens is None:
+ raise ValueError("Reference at %r does not exist" % self.path)
+
# is it a reference ?
if tokens[0] == 'ref:':
return (None, tokens[1])
@@ -417,7 +420,6 @@ class SymbolicReference(object):
def _iter_items(cls, repo, common_path = None):
if common_path is None:
common_path = cls._common_path_default
-
rela_paths = set()
# walk loose refs
@@ -516,7 +518,7 @@ class Reference(SymbolicReference, LazyMixin, Iterable):
"""
if not path.startswith(self._common_path_default+'/'):
- raise ValueError("Cannot instantiate %s from path %s" % ( self.__class__.__name__, path ))
+ raise ValueError("Cannot instantiate %r from path %s" % ( self.__class__.__name__, path ))
super(Reference, self).__init__(repo, path)