diff options
| author | Patrick Steinhardt <ps@pks.im> | 2017-11-12 10:31:48 +0000 |
|---|---|---|
| committer | Patrick Steinhardt <ps@pks.im> | 2018-06-22 09:52:12 +0200 |
| commit | c16556aaddffc1d663c6403747d793adc0819e0a (patch) | |
| tree | 6bf65254b08ffa9eb528e392b8b44bc274eedcba /src/pack-objects.c | |
| parent | a616fb1668fcf406dbcd8dcc241d5a3613669e62 (diff) | |
| download | libgit2-c16556aaddffc1d663c6403747d793adc0819e0a.tar.gz | |
indexer: introduce options struct to `git_indexer_new`
We strive to keep an options structure to many functions to be able to
extend options in the future without breaking the API. `git_indexer_new`
doesn't have one right now, but we want to be able to add an option
for enabling strict packfile verification.
Add a new `git_indexer_options` structure and adjust callers to use
that.
Diffstat (limited to 'src/pack-objects.c')
| -rw-r--r-- | src/pack-objects.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/pack-objects.c b/src/pack-objects.c index c12f25ea5..2b786df33 100644 --- a/src/pack-objects.c +++ b/src/pack-objects.c @@ -1388,6 +1388,7 @@ int git_packbuilder_write( git_transfer_progress_cb progress_cb, void *progress_cb_payload) { + git_indexer_options opts = GIT_INDEXER_OPTIONS_INIT; git_indexer *indexer; git_transfer_progress stats; struct pack_write_context ctx; @@ -1395,8 +1396,11 @@ int git_packbuilder_write( PREPARE_PACK; + opts.progress_cb = progress_cb; + opts.progress_cb_payload = progress_cb_payload; + if (git_indexer_new( - &indexer, path, mode, pb->odb, progress_cb, progress_cb_payload) < 0) + &indexer, path, mode, pb->odb, &opts) < 0) return -1; if (!git_repository__cvar(&t, pb->repo, GIT_CVAR_FSYNCOBJECTFILES) && t) |
