From 550c966111cc490210342304eedb32290a7c5e51 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=2E=20David=20Ib=C3=A1=C3=B1ez?= Date: Mon, 2 Jan 2012 20:10:28 +0100 Subject: [PATCH] Rename Index.create_tree to Index.write_tree Like Git command "git write-tree" --- pygit2.c | 6 +++--- test/test_index.py | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/pygit2.c b/pygit2.c index 270a966..7a79b3d 100644 --- a/pygit2.c +++ b/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} }; diff --git a/test/test_index.py b/test/test_index.py index ae3768f..7c566a3 100644 --- a/test/test_index.py +++ b/test/test_index.py @@ -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')