tree: rename Tree.attributes to Tree.filemode.
This catches up with changes in libgit2: commit 9d7ac675d06dab2e000ad32f9248631af0191f85 Author: nulltoken <emeric.fermas@gmail.com> Date: Tue Aug 21 11:45:16 2012 +0200 tree entry: rename git_tree_entry_attributes() into git_tree_entry_filemode()
This commit is contained in:
parent
8e19102815
commit
651aa6a830
@ -200,7 +200,7 @@ This is the interface of a tree entry::
|
||||
TreeEntry.name -- name of the tree entry
|
||||
TreeEntry.oid -- the id of the git object
|
||||
TreeEntry.hex -- hexadecimal representation of the oid
|
||||
TreeEntry.attributes -- the Unix file attributes
|
||||
TreeEntry.filemode -- the Unix file attributes
|
||||
TreeEntry.to_object() -- returns the git object (equivalent to repo[entry.oid])
|
||||
|
||||
|
||||
|
@ -33,7 +33,7 @@
|
||||
#include <git2.h>
|
||||
#include <pygit2/types.h>
|
||||
|
||||
PyObject* TreeEntry_get_attributes(TreeEntry *self);
|
||||
PyObject* TreeEntry_get_filemode(TreeEntry *self);
|
||||
PyObject* TreeEntry_get_name(TreeEntry *self);
|
||||
PyObject* TreeEntry_get_oid(TreeEntry *self);
|
||||
PyObject* TreeEntry_get_hex(TreeEntry *self);
|
||||
|
@ -46,9 +46,9 @@ TreeEntry_dealloc(TreeEntry *self)
|
||||
}
|
||||
|
||||
PyObject *
|
||||
TreeEntry_get_attributes(TreeEntry *self)
|
||||
TreeEntry_get_filemode(TreeEntry *self)
|
||||
{
|
||||
return PyInt_FromLong(git_tree_entry_attributes(self->entry));
|
||||
return PyInt_FromLong(git_tree_entry_filemode(self->entry));
|
||||
}
|
||||
|
||||
PyObject *
|
||||
@ -84,7 +84,7 @@ TreeEntry_to_object(TreeEntry *self)
|
||||
}
|
||||
|
||||
PyGetSetDef TreeEntry_getseters[] = {
|
||||
{"attributes", (getter)TreeEntry_get_attributes, NULL, "attributes", NULL},
|
||||
{"filemode", (getter)TreeEntry_get_filemode, NULL, "filemode", NULL},
|
||||
{"name", (getter)TreeEntry_get_name, NULL, "name", NULL},
|
||||
{"oid", (getter)TreeEntry_get_oid, NULL, "object id", NULL},
|
||||
{"hex", (getter)TreeEntry_get_hex, NULL, "hex oid", NULL},
|
||||
|
@ -42,11 +42,11 @@ SUBTREE_SHA = '614fd9a3094bf618ea938fffc00e7d1a54f89ad0'
|
||||
|
||||
class TreeTest(utils.BareRepoTestCase):
|
||||
|
||||
def assertTreeEntryEqual(self, entry, sha, name, attributes):
|
||||
def assertTreeEntryEqual(self, entry, sha, name, filemode):
|
||||
self.assertEqual(entry.hex, sha)
|
||||
self.assertEqual(entry.name, name)
|
||||
self.assertEqual(entry.attributes, attributes,
|
||||
'0%o != 0%o' % (entry.attributes, attributes))
|
||||
self.assertEqual(entry.filemode, filemode,
|
||||
'0%o != 0%o' % (entry.filemode, filemode))
|
||||
|
||||
def test_read_tree(self):
|
||||
tree = self.repo[TREE_SHA]
|
||||
|
@ -57,7 +57,7 @@ class TreeBuilderTest(utils.BareRepoTestCase):
|
||||
tree = self.repo[TREE_SHA]
|
||||
bld = self.repo.TreeBuilder()
|
||||
for e in tree:
|
||||
bld.insert(e.name, e.hex, e.attributes)
|
||||
bld.insert(e.name, e.hex, e.filemode)
|
||||
|
||||
result = bld.write()
|
||||
self.assertEqual(tree.oid, result)
|
||||
|
Loading…
x
Reference in New Issue
Block a user