summaryrefslogtreecommitdiff
path: root/refs/symbolic.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2010-11-24 19:36:34 +0100
committerSebastian Thiel <byronimo@gmail.com>2010-11-24 19:37:06 +0100
commit98a313305f0d554a179b93695d333199feb5266c (patch)
tree853a7029fa8c532da110b11afc2b60027e267625 /refs/symbolic.py
parent86523260c495d9a29aa5ab29d50d30a5d1981a0c (diff)
downloadgitpython-98a313305f0d554a179b93695d333199feb5266c.tar.gz
RefLog: added entry_at method, which is a faster way of reading single entries, including test
Diffstat (limited to 'refs/symbolic.py')
-rw-r--r--refs/symbolic.py9
1 files changed, 9 insertions, 0 deletions
diff --git a/refs/symbolic.py b/refs/symbolic.py
index f333bd46..6ba8083f 100644
--- a/refs/symbolic.py
+++ b/refs/symbolic.py
@@ -354,6 +354,15 @@ class SymbolicReference(object):
(newbinsha is None and self.commit.binsha) or newbinsha,
message)
+ def log_entry(self, index):
+ """:return: RefLogEntry at the given index
+ :param index: python list compatible positive or negative index
+
+ .. note:: This method must read part of the reflog during execution, hence
+ it should be used sparringly, or only if you need just one index.
+ In that case, it will be faster than the ``log()`` method"""
+ return RefLog.entry_at(RefLog.path(self), index)
+
@classmethod
def to_full_path(cls, path):
"""