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 /src/pack-objects.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 'src/pack-objects.c')
-rw-r--r-- | src/pack-objects.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/pack-objects.c b/src/pack-objects.c index 93541e974..938b28fde 100644 --- a/src/pack-objects.c +++ b/src/pack-objects.c @@ -35,7 +35,7 @@ struct tree_walk_context { }; struct pack_write_context { - git_indexer_stream *indexer; + git_indexer *indexer; git_transfer_progress *stats; }; @@ -1242,7 +1242,7 @@ int git_packbuilder_write_buf(git_buf *buf, git_packbuilder *pb) static int write_cb(void *buf, size_t len, void *payload) { struct pack_write_context *ctx = payload; - return git_indexer_stream_add(ctx->indexer, buf, len, ctx->stats); + return git_indexer_append(ctx->indexer, buf, len, ctx->stats); } int git_packbuilder_write( @@ -1251,13 +1251,13 @@ int git_packbuilder_write( git_transfer_progress_callback progress_cb, void *progress_cb_payload) { - git_indexer_stream *indexer; + git_indexer *indexer; git_transfer_progress stats; struct pack_write_context ctx; PREPARE_PACK; - if (git_indexer_stream_new( + if (git_indexer_new( &indexer, path, pb->odb, progress_cb, progress_cb_payload) < 0) return -1; @@ -1265,12 +1265,12 @@ int git_packbuilder_write( ctx.stats = &stats; if (git_packbuilder_foreach(pb, write_cb, &ctx) < 0 || - git_indexer_stream_finalize(indexer, &stats) < 0) { - git_indexer_stream_free(indexer); + git_indexer_commit(indexer, &stats) < 0) { + git_indexer_free(indexer); return -1; } - git_indexer_stream_free(indexer); + git_indexer_free(indexer); return 0; } |