Rename Index.create_tree to Index.write_tree
Like Git command "git write-tree"
This commit is contained in:
6
pygit2.c
6
pygit2.c
@@ -1986,7 +1986,7 @@ Index_setitem(Index *self, PyObject *key, PyObject *value)
|
||||
}
|
||||
|
||||
static PyObject *
|
||||
Index_create_tree(Index *self)
|
||||
Index_write_tree(Index *self)
|
||||
{
|
||||
git_oid oid;
|
||||
int err;
|
||||
@@ -2012,8 +2012,8 @@ static PyMethodDef Index_methods[] = {
|
||||
{"write", (PyCFunction)Index_write, METH_NOARGS,
|
||||
"Write an existing index object from memory back to disk using an"
|
||||
" atomic file lock."},
|
||||
{"create_tree", (PyCFunction)Index_create_tree, METH_NOARGS,
|
||||
"Create a tree from the index file, return its SHA."},
|
||||
{"write_tree", (PyCFunction)Index_write_tree, METH_NOARGS,
|
||||
"Create a tree object from the index file, return its oid."},
|
||||
{NULL}
|
||||
};
|
||||
|
||||
|
@@ -92,8 +92,8 @@ class IndexTest(utils.RepoTestCase):
|
||||
index.read()
|
||||
self.assertTrue('bye.txt' in index)
|
||||
|
||||
def test_create_tree(self):
|
||||
oid = self.repo.index.create_tree()
|
||||
def test_write_tree(self):
|
||||
oid = self.repo.index.write_tree()
|
||||
sha = b2a_hex(oid).decode('ascii')
|
||||
self.assertEqual(sha, 'fd937514cb799514d4b81bb24c5fcfeb6472b245')
|
||||
|
||||
|
Reference in New Issue
Block a user