diff options
author | Sebastian Thiel <byronimo@gmail.com> | 2010-11-23 15:58:32 +0100 |
---|---|---|
committer | Sebastian Thiel <byronimo@gmail.com> | 2010-11-23 16:04:42 +0100 |
commit | 8ad01ee239f9111133e52af29b78daed34c52e49 (patch) | |
tree | 8c20fda5672687fbb7b1f731e303c295954ea142 /refs/symbolic.py | |
parent | a93eb7e8484e5bb40f9b8d11ac64a1621cf4c9cd (diff) | |
download | gitpython-8ad01ee239f9111133e52af29b78daed34c52e49.tar.gz |
SymbolicReference: log method added, including test
Diffstat (limited to 'refs/symbolic.py')
-rw-r--r-- | refs/symbolic.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/refs/symbolic.py b/refs/symbolic.py index 3329d51c..9dd7629c 100644 --- a/refs/symbolic.py +++ b/refs/symbolic.py @@ -16,6 +16,8 @@ from gitdb.util import ( hex_to_bin ) +from log import RefLog + __all__ = ["SymbolicReference"] class SymbolicReference(object): @@ -270,6 +272,14 @@ class SymbolicReference(object): except TypeError: return True + def log(self): + """ + :return: RefLog for this reference. Its last entry reflects the latest change + applied to this reference + + .. note:: As the log is parsed every time, its recommended to cache it for use + instead of calling this method repeatedly""" + return RefLog.from_file(RefLog.path(self)) @classmethod def to_full_path(cls, path): |