diff options
| author | Carlos Martín Nieto <cmn@dwim.me> | 2013-10-30 15:00:05 +0100 |
|---|---|---|
| committer | Carlos Martín Nieto <cmn@dwim.me> | 2013-10-30 15:00:05 +0100 |
| commit | a6154f2183043626cdbe995b4795346610b5862e (patch) | |
| tree | da7018cc6cf06bf27cb11cef356d6b9fde31b9fd /tests-clar/pack/indexer.c | |
| parent | 5c50f22a93c78190fb7d81802199ff9defc8cf55 (diff) | |
| download | libgit2-a6154f2183043626cdbe995b4795346610b5862e.tar.gz | |
indexer: remove the stream infix
It was there to keep it apart from the one which read in from a file on
disk. This other indexer does not exist anymore, so there is no need for
anything other than git_indexer to refer to it.
While here, rename _add() function to _append() and _finalize() to
_commit(). The former change is cosmetic, while the latter avoids
talking about "finalizing", which OO languages use to mean something
completely different.
Diffstat (limited to 'tests-clar/pack/indexer.c')
| -rw-r--r-- | tests-clar/pack/indexer.c | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/tests-clar/pack/indexer.c b/tests-clar/pack/indexer.c index 17ec7b3f8..e26b3ec20 100644 --- a/tests-clar/pack/indexer.c +++ b/tests-clar/pack/indexer.c @@ -45,23 +45,23 @@ unsigned int base_obj_len = 2; void test_pack_indexer__out_of_order(void) { - git_indexer_stream *idx; + git_indexer *idx; git_transfer_progress stats; - cl_git_pass(git_indexer_stream_new(&idx, ".", NULL, NULL, NULL)); - cl_git_pass(git_indexer_stream_add(idx, out_of_order_pack, out_of_order_pack_len, &stats)); - cl_git_pass(git_indexer_stream_finalize(idx, &stats)); + cl_git_pass(git_indexer_new(&idx, ".", NULL, NULL, NULL)); + cl_git_pass(git_indexer_append(idx, out_of_order_pack, out_of_order_pack_len, &stats)); + cl_git_pass(git_indexer_commit(idx, &stats)); cl_assert_equal_i(stats.total_objects, 3); cl_assert_equal_i(stats.received_objects, 3); cl_assert_equal_i(stats.indexed_objects, 3); - git_indexer_stream_free(idx); + git_indexer_free(idx); } void test_pack_indexer__fix_thin(void) { - git_indexer_stream *idx; + git_indexer *idx; git_transfer_progress stats; git_repository *repo; git_odb *odb; @@ -75,9 +75,9 @@ void test_pack_indexer__fix_thin(void) git_oid_fromstr(&should_id, "e68fe8129b546b101aee9510c5328e7f21ca1d18"); cl_assert(!git_oid_cmp(&id, &should_id)); - cl_git_pass(git_indexer_stream_new(&idx, ".", odb, NULL, NULL)); - cl_git_pass(git_indexer_stream_add(idx, thin_pack, thin_pack_len, &stats)); - cl_git_pass(git_indexer_stream_finalize(idx, &stats)); + cl_git_pass(git_indexer_new(&idx, ".", odb, NULL, NULL)); + cl_git_pass(git_indexer_append(idx, thin_pack, thin_pack_len, &stats)); + cl_git_pass(git_indexer_commit(idx, &stats)); cl_assert_equal_i(stats.total_objects, 2); cl_assert_equal_i(stats.received_objects, 2); @@ -85,9 +85,9 @@ void test_pack_indexer__fix_thin(void) cl_assert_equal_i(stats.local_objects, 1); git_oid_fromstr(&should_id, "11f0f69b334728fdd8bc86b80499f22f29d85b15"); - cl_assert(!git_oid_cmp(git_indexer_stream_hash(idx), &should_id)); + cl_assert(!git_oid_cmp(git_indexer_hash(idx), &should_id)); - git_indexer_stream_free(idx); + git_indexer_free(idx); git_odb_free(odb); git_repository_free(repo); @@ -110,19 +110,19 @@ void test_pack_indexer__fix_thin(void) cl_git_pass(p_stat(name, &st)); left = st.st_size; - cl_git_pass(git_indexer_stream_new(&idx, ".", NULL, NULL, NULL)); + cl_git_pass(git_indexer_new(&idx, ".", NULL, NULL, NULL)); read = p_read(fd, buffer, sizeof(buffer)); cl_assert(read != -1); p_close(fd); - cl_git_pass(git_indexer_stream_add(idx, buffer, read, &stats)); - cl_git_pass(git_indexer_stream_finalize(idx, &stats)); + cl_git_pass(git_indexer_append(idx, buffer, read, &stats)); + cl_git_pass(git_indexer_commit(idx, &stats)); cl_assert_equal_i(stats.total_objects, 3); cl_assert_equal_i(stats.received_objects, 3); cl_assert_equal_i(stats.indexed_objects, 3); cl_assert_equal_i(stats.local_objects, 0); - git_indexer_stream_free(idx); + git_indexer_free(idx); } } |
