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 /examples/network/index-pack.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 'examples/network/index-pack.c')
-rw-r--r-- | examples/network/index-pack.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/examples/network/index-pack.c b/examples/network/index-pack.c index 08b45c58c..59fff416a 100644 --- a/examples/network/index-pack.c +++ b/examples/network/index-pack.c @@ -31,7 +31,7 @@ static int index_cb(const git_transfer_progress *stats, void *data) int index_pack(git_repository *repo, int argc, char **argv) { - git_indexer_stream *idx; + git_indexer *idx; git_transfer_progress stats = {0, 0}; int error; char hash[GIT_OID_HEXSZ + 1] = {0}; @@ -46,7 +46,7 @@ int index_pack(git_repository *repo, int argc, char **argv) return EXIT_FAILURE; } - if (git_indexer_stream_new(&idx, ".", NULL, NULL, NULL) < 0) { + if (git_indexer_new(&idx, ".", NULL, NULL, NULL) < 0) { puts("bad idx"); return -1; } @@ -61,7 +61,7 @@ int index_pack(git_repository *repo, int argc, char **argv) if (read_bytes < 0) break; - if ((error = git_indexer_stream_add(idx, buf, read_bytes, &stats)) < 0) + if ((error = git_indexer_append(idx, buf, read_bytes, &stats)) < 0) goto cleanup; index_cb(&stats, NULL); @@ -73,16 +73,16 @@ int index_pack(git_repository *repo, int argc, char **argv) goto cleanup; } - if ((error = git_indexer_stream_finalize(idx, &stats)) < 0) + if ((error = git_indexer_commit(idx, &stats)) < 0) goto cleanup; printf("\rIndexing %d of %d\n", stats.indexed_objects, stats.total_objects); - git_oid_fmt(hash, git_indexer_stream_hash(idx)); + git_oid_fmt(hash, git_indexer_hash(idx)); puts(hash); cleanup: close(fd); - git_indexer_stream_free(idx); + git_indexer_free(idx); return error; } |