summaryrefslogtreecommitdiff
path: root/tests-clay/object
diff options
context:
space:
mode:
authorVicent Martí <tanoku@gmail.com>2012-01-02 10:06:24 +0100
committerVicent Martí <tanoku@gmail.com>2012-01-02 10:06:24 +0100
commit1d415455d9484e99dcaa7f061bc9b172c083dabe (patch)
tree2d50afc6d35a06c6f9b3eb037b129e26b0a045ee /tests-clay/object
parent7a704309ae012b8e92eb6103b0d14dd3c22a1cb5 (diff)
downloadlibgit2-1d415455d9484e99dcaa7f061bc9b172c083dabe.tar.gz
clay: Move `file_create` to the helpers file
Diffstat (limited to 'tests-clay/object')
-rw-r--r--tests-clay/object/commit/commitstagedfile.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/tests-clay/object/commit/commitstagedfile.c b/tests-clay/object/commit/commitstagedfile.c
index 80ae3d549..fd149bfc3 100644
--- a/tests-clay/object/commit/commitstagedfile.c
+++ b/tests-clay/object/commit/commitstagedfile.c
@@ -3,16 +3,6 @@
static git_repository *repo;
-static void file_create(const char *filename, const char *content)
-{
- int fd;
-
- fd = p_creat(filename, 0666);
- cl_assert(fd != 0);
- cl_git_pass(p_write(fd, content, strlen(content)));
- cl_git_pass(p_close(fd));
-}
-
void test_object_commit_commitstagedfile__initialize(void)
{
cl_fixture("treebuilder");
@@ -79,7 +69,7 @@ void test_object_commit_commitstagedfile__generate_predictable_object_ids(void)
/*
* Add a new file to the index
*/
- file_create("treebuilder/test.txt", "test\n");
+ cl_git_mkfile("treebuilder/test.txt", "test\n");
cl_git_pass(git_repository_index(&index, repo));
cl_git_pass(git_index_add(index, "test.txt", 0));