summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2016-03-20 11:00:12 +0100
committerCarlos Martín Nieto <cmn@dwim.me>2016-03-20 11:00:12 +0100
commit60a194aa86d54ffb55c1abff8d0ef05647f936e8 (patch)
treef8312c890d8a5862d1d3ee705fe97fc0778f1bb2 /tests
parentec5a43b60ab0dfcb42db8101edfca34be3d62947 (diff)
downloadlibgit2-60a194aa86d54ffb55c1abff8d0ef05647f936e8.tar.gz
tree: re-use the id and filename in the odb object
Instead of copying over the data into the individual entries, point to the originals, which are already in a format we can use.
Diffstat (limited to 'tests')
-rw-r--r--tests/diff/iterator.c2
-rw-r--r--tests/object/tree/attributes.c2
2 files changed, 3 insertions, 1 deletions
diff --git a/tests/diff/iterator.c b/tests/diff/iterator.c
index 8417e8ed4..25a23eda7 100644
--- a/tests/diff/iterator.c
+++ b/tests/diff/iterator.c
@@ -268,7 +268,7 @@ static void check_tree_entry(
cl_git_pass(git_iterator_current_tree_entry(&te, i));
cl_assert(te);
- cl_assert(git_oid_streq(&te->oid, oid) == 0);
+ cl_assert(git_oid_streq(te->oid, oid) == 0);
cl_git_pass(git_iterator_current(&ie, i));
cl_git_pass(git_buf_sets(&path, ie->path));
diff --git a/tests/object/tree/attributes.c b/tests/object/tree/attributes.c
index 413514c48..8654dfa31 100644
--- a/tests/object/tree/attributes.c
+++ b/tests/object/tree/attributes.c
@@ -82,6 +82,7 @@ void test_object_tree_attributes__normalize_attributes_when_creating_a_tree_from
cl_git_pass(git_treebuilder_new(&builder, repo, tree));
entry = git_treebuilder_get(builder, "old_mode.txt");
+ cl_assert(entry != NULL);
cl_assert_equal_i(
GIT_FILEMODE_BLOB,
git_tree_entry_filemode(entry));
@@ -92,6 +93,7 @@ void test_object_tree_attributes__normalize_attributes_when_creating_a_tree_from
cl_git_pass(git_tree_lookup(&tree, repo, &tid2));
entry = git_tree_entry_byname(tree, "old_mode.txt");
+ cl_assert(entry != NULL);
cl_assert_equal_i(
GIT_FILEMODE_BLOB,
git_tree_entry_filemode(entry));