summaryrefslogtreecommitdiff
path: root/lib/git
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
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')
-rw-r--r--lib/git/__init__.py2
-rw-r--r--lib/git/base.py27
2 files changed, 8 insertions, 21 deletions
diff --git a/lib/git/__init__.py b/lib/git/__init__.py
index 45cb4673..5ce3c122 100644
--- a/lib/git/__init__.py
+++ b/lib/git/__init__.py
@@ -18,7 +18,7 @@ from git.cmd import Git
from git.head import Head
from git.repo import Repo
from git.stats import Stats
-from git.tag import Tag
+from git.tag import Tag,TagRef,TagObject
from git.tree import Tree
from git.utils import dashify
from git.utils import touch
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)