summaryrefslogtreecommitdiff
path: root/lib/git/base.py
diff options
context:
space:
mode:
authorSebastian Thiel <byronimo@gmail.com>2009-10-11 22:50:07 +0200
committerSebastian Thiel <byronimo@gmail.com>2009-10-11 22:50:07 +0200
commitc68459a17ff59043d29c90020fffe651b2164e6a (patch)
treea5b715a490d9cbd8f45eabc1968374c96bdea1c0 /lib/git/base.py
parentb01824b1aecf8aadae4501e22feb45c20fb26bce (diff)
downloadgitpython-c68459a17ff59043d29c90020fffe651b2164e6a.tar.gz
Added remaining tests for new base classes and removed some methods whose existance was doubtful or unsafe
Diffstat (limited to 'lib/git/base.py')
-rw-r--r--lib/git/base.py27
1 files changed, 7 insertions, 20 deletions
diff --git a/lib/git/base.py b/lib/git/base.py
index 4e5298e4..252ebe4b 100644
--- a/lib/git/base.py
+++ b/lib/git/base.py
@@ -110,14 +110,6 @@ class Object(LazyMixin):
"""
return '<git.%s "%s">' % (self.__class__.__name__, self.id)
- @property
- def id_abbrev(self):
- """
- Returns
- First 7 bytes of the commit's sha id as an abbreviation of the full string.
- """
- return self.id[0:7]
-
@classmethod
def get_type_by_name(cls, object_type_name):
"""
@@ -169,12 +161,15 @@ class IndexObject(Object):
``path`` : str
is the path to the file in the file system, relative to the git repository root, i.e.
file.ext or folder/other.ext
+
+ NOTE
+ Path may not be set of the index object has been created directly as it cannot
+ be retrieved without knowing the parent tree.
"""
super(IndexObject, self).__init__(repo, id)
+ self._set_self_from_args_(locals())
if isinstance(mode, basestring):
- mode = self._mode_str_to_int(mode)
- self.mode = mode
- self.path = path
+ self.mode = self._mode_str_to_int(mode)
@classmethod
def _mode_str_to_int( cls, modestr ):
@@ -191,14 +186,6 @@ class IndexObject(Object):
mode += int(char) << iteration*3
# END for each char
return mode
-
- @property
- def basename(self):
- """
- Returns
- The basename of the IndexObject's file path
- """
- return os.path.basename(self.path)
class Ref(object):
@@ -222,7 +209,7 @@ class Ref(object):
self.object = object
def __str__(self):
- return self.name()
+ return self.name
def __repr__(self):
return '<git.%s "%s">' % (self.__class__.__name__, self.path)