diff options
author | Edward Thomson <ethomson@edwardthomson.com> | 2012-10-30 05:04:21 +0400 |
---|---|---|
committer | Edward Thomson <ethomson@edwardthomson.com> | 2012-10-30 05:04:21 +0400 |
commit | f45ec1a076e2347ba5d63eeb2d158f87b612e5cb (patch) | |
tree | 2e2bebc12e64e6f48eabde6010bf775b3fc6cd6e /tests-clar/index/tests.c | |
parent | 81eecc342b3580e9b05e501c8ee75c7e2e0dca1a (diff) |
index refactoring
Diffstat (limited to 'tests-clar/index/tests.c')
-rw-r--r-- | tests-clar/index/tests.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/tests-clar/index/tests.c b/tests-clar/index/tests.c index a535d6815..cf971e1dd 100644 --- a/tests-clar/index/tests.c +++ b/tests-clar/index/tests.c @@ -231,15 +231,19 @@ void test_index_tests__add(void) cl_git_pass(git_oid_fromstr(&id1, "a8233120f6ad708f843d861ce2b7228ec4e3dec6")); /* Add the new file to the index */ - cl_git_pass(git_index_add(index, "test.txt", 0)); + cl_git_pass(git_index_add_from_workdir(index, "test.txt")); /* Wow... it worked! */ cl_assert(git_index_entrycount(index) == 1); - entry = git_index_get(index, 0); + entry = git_index_get_byindex(index, 0); /* And the built-in hashing mechanism worked as expected */ cl_assert(git_oid_cmp(&id1, &entry->oid) == 0); + /* Test access by path instead of index */ + cl_assert((entry = git_index_get_bypath(index, "test.txt", 0)) != NULL); + cl_assert(git_oid_cmp(&id1, &entry->oid) == 0); + git_index_free(index); git_repository_free(repo); } |