Rename Index.create_tree to Index.write_tree

Like Git command "git write-tree"
This commit is contained in:
J. David Ibáñez
2012-01-02 20:10:28 +01:00
parent 35ed84cf44
commit 550c966111
2 changed files with 5 additions and 5 deletions

View File

@@ -1986,7 +1986,7 @@ Index_setitem(Index *self, PyObject *key, PyObject *value)
} }
static PyObject * static PyObject *
Index_create_tree(Index *self) Index_write_tree(Index *self)
{ {
git_oid oid; git_oid oid;
int err; int err;
@@ -2012,8 +2012,8 @@ static PyMethodDef Index_methods[] = {
{"write", (PyCFunction)Index_write, METH_NOARGS, {"write", (PyCFunction)Index_write, METH_NOARGS,
"Write an existing index object from memory back to disk using an" "Write an existing index object from memory back to disk using an"
" atomic file lock."}, " atomic file lock."},
{"create_tree", (PyCFunction)Index_create_tree, METH_NOARGS, {"write_tree", (PyCFunction)Index_write_tree, METH_NOARGS,
"Create a tree from the index file, return its SHA."}, "Create a tree object from the index file, return its oid."},
{NULL} {NULL}
}; };

View File

@@ -92,8 +92,8 @@ class IndexTest(utils.RepoTestCase):
index.read() index.read()
self.assertTrue('bye.txt' in index) self.assertTrue('bye.txt' in index)
def test_create_tree(self): def test_write_tree(self):
oid = self.repo.index.create_tree() oid = self.repo.index.write_tree()
sha = b2a_hex(oid).decode('ascii') sha = b2a_hex(oid).decode('ascii')
self.assertEqual(sha, 'fd937514cb799514d4b81bb24c5fcfeb6472b245') self.assertEqual(sha, 'fd937514cb799514d4b81bb24c5fcfeb6472b245')