summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Belfer <arrbee@arrbee.com>2011-12-18 12:21:18 -0800
committerRussell Belfer <arrbee@arrbee.com>2011-12-18 12:21:18 -0800
commitbe00b00dd1468f1c625ca3fadc61f2a16edfb8d5 (patch)
tree1cbcf751a98096a3d052644f792a0e1d7cb4e2ad
parent86e356ee51b07049202078b1ad2f23ac7136075e (diff)
downloadlibgit2-be00b00dd1468f1c625ca3fadc61f2a16edfb8d5.tar.gz
Add unit test for proper init of index entries
-rw-r--r--tests-clay/object/commit/commitstagedfile.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests-clay/object/commit/commitstagedfile.c b/tests-clay/object/commit/commitstagedfile.c
index b6730052c..80ae3d549 100644
--- a/tests-clay/object/commit/commitstagedfile.c
+++ b/tests-clay/object/commit/commitstagedfile.c
@@ -88,6 +88,17 @@ void test_object_commit_commitstagedfile__generate_predictable_object_ids(void)
cl_assert(git_oid_cmp(&expected_blob_oid, &entry->oid) == 0);
/*
+ * Information about index entry should match test file
+ */
+ {
+ struct stat st;
+ cl_must_pass(p_lstat("treebuilder/test.txt", &st));
+ cl_assert(entry->file_size == st.st_size);
+ cl_assert(entry->uid == st.st_uid);
+ cl_assert(entry->gid == st.st_gid);
+ }
+
+ /*
* Build the tree from the index
*/
cl_git_pass(git_tree_create_fromindex(&tree_oid, index));