diff options
Diffstat (limited to 'lib/git/objects/base.py')
-rw-r--r-- | lib/git/objects/base.py | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/git/objects/base.py b/lib/git/objects/base.py index 6dd03ba4..b0989a43 100644 --- a/lib/git/objects/base.py +++ b/lib/git/objects/base.py @@ -196,3 +196,20 @@ class IndexObject(Object): # END for each char return mode + @property + def name(self): + """ + Returns + Name portion of the path, effectively being the basename + """ + return os.path.basename(self.path) + + @property + def abspath(self): + """ + Returns + Absolute path to this index object in the file system ( as opposed to the + .path field which is a path relative to the git repository ) + """ + return os.path.join(self.repo.git.git_dir, self.path) + |