Skip to content

Commit a1ef995

Browse files
committed
indexer: use git_indexer_progress throughout
Update internal usage of `git_transfer_progress` to `git_indexer_progreses`.
1 parent 975d672 commit a1ef995

File tree

27 files changed

+74
-74
lines changed

27 files changed

+74
-74
lines changed

examples/clone.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include "common.h"
22

33
typedef struct progress_data {
4-
git_transfer_progress fetch_progress;
4+
git_indexer_progress fetch_progress;
55
size_t completed_steps;
66
size_t total_steps;
77
const char *path;
@@ -46,7 +46,7 @@ static int sideband_progress(const char *str, int len, void *payload)
4646
return 0;
4747
}
4848

49-
static int fetch_progress(const git_transfer_progress *stats, void *payload)
49+
static int fetch_progress(const git_indexer_progress *stats, void *payload)
5050
{
5151
progress_data *pd = (progress_data*)payload;
5252
pd->fetch_progress = *stats;

examples/fetch.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ static int update_cb(const char *refname, const git_oid *a, const git_oid *b, vo
3838
* data. Most frontends will probably want to show a percentage and
3939
* the download rate.
4040
*/
41-
static int transfer_progress_cb(const git_transfer_progress *stats, void *payload)
41+
static int transfer_progress_cb(const git_indexer_progress *stats, void *payload)
4242
{
4343
(void)payload;
4444

@@ -57,7 +57,7 @@ static int transfer_progress_cb(const git_transfer_progress *stats, void *payloa
5757
int lg2_fetch(git_repository *repo, int argc, char **argv)
5858
{
5959
git_remote *remote = NULL;
60-
const git_transfer_progress *stats;
60+
const git_indexer_progress *stats;
6161
git_fetch_options fetch_opts = GIT_FETCH_OPTIONS_INIT;
6262

6363
if (argc < 2) {

examples/index-pack.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
* This could be run in the main loop whilst the application waits for
2121
* the indexing to finish in a worker thread
2222
*/
23-
static int index_cb(const git_transfer_progress *stats, void *data)
23+
static int index_cb(const git_indexer_progress *stats, void *data)
2424
{
2525
(void)data;
2626
printf("\rProcessing %d of %d", stats->indexed_objects, stats->total_objects);
@@ -31,7 +31,7 @@ static int index_cb(const git_transfer_progress *stats, void *data)
3131
int lg2_index_pack(git_repository *repo, int argc, char **argv)
3232
{
3333
git_indexer *idx;
34-
git_transfer_progress stats = {0, 0};
34+
git_indexer_progress stats = {0, 0};
3535
int error;
3636
char hash[GIT_OID_HEXSZ + 1] = {0};
3737
int fd;

fuzzers/packfile_fuzzer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ int LLVMFuzzerInitialize(int *argc, char ***argv)
5555
int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size)
5656
{
5757
git_indexer *indexer = NULL;
58-
git_transfer_progress stats = {0, 0};
58+
git_indexer_progress stats = {0, 0};
5959
bool append_hash = false;
6060
git_oid id;
6161
char hash[GIT_OID_HEXSZ + 1] = {0};

include/git2/indexer.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ typedef struct git_indexer_options {
6464
unsigned int version;
6565

6666
/** progress_cb function to call with progress information */
67-
git_transfer_progress_cb progress_cb;
67+
git_indexer_progress_cb progress_cb;
6868
/** progress_cb_payload payload for the progress callback */
6969
void *progress_cb_payload;
7070

@@ -114,7 +114,7 @@ GIT_EXTERN(int) git_indexer_new(
114114
* @param size the size of the data in bytes
115115
* @param stats stat storage
116116
*/
117-
GIT_EXTERN(int) git_indexer_append(git_indexer *idx, const void *data, size_t size, git_transfer_progress *stats);
117+
GIT_EXTERN(int) git_indexer_append(git_indexer *idx, const void *data, size_t size, git_indexer_progress *stats);
118118

119119
/**
120120
* Finalize the pack and index
@@ -123,7 +123,7 @@ GIT_EXTERN(int) git_indexer_append(git_indexer *idx, const void *data, size_t si
123123
*
124124
* @param idx the indexer
125125
*/
126-
GIT_EXTERN(int) git_indexer_commit(git_indexer *idx, git_transfer_progress *stats);
126+
GIT_EXTERN(int) git_indexer_commit(git_indexer *idx, git_indexer_progress *stats);
127127

128128
/**
129129
* Get the packfile's hash

include/git2/odb.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ GIT_EXTERN(int) git_odb_open_rstream(
391391
GIT_EXTERN(int) git_odb_write_pack(
392392
git_odb_writepack **out,
393393
git_odb *db,
394-
git_transfer_progress_cb progress_cb,
394+
git_indexer_progress_cb progress_cb,
395395
void *progress_payload);
396396

397397
/**

include/git2/odb_backend.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -124,8 +124,8 @@ struct git_odb_stream {
124124
struct git_odb_writepack {
125125
git_odb_backend *backend;
126126

127-
int GIT_CALLBACK(append)(git_odb_writepack *writepack, const void *data, size_t size, git_transfer_progress *stats);
128-
int GIT_CALLBACK(commit)(git_odb_writepack *writepack, git_transfer_progress *stats);
127+
int GIT_CALLBACK(append)(git_odb_writepack *writepack, const void *data, size_t size, git_indexer_progress *stats);
128+
int GIT_CALLBACK(commit)(git_odb_writepack *writepack, git_indexer_progress *stats);
129129
void GIT_CALLBACK(free)(git_odb_writepack *writepack);
130130
};
131131

include/git2/pack.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,7 @@ GIT_EXTERN(int) git_packbuilder_write(
165165
git_packbuilder *pb,
166166
const char *path,
167167
unsigned int mode,
168-
git_transfer_progress_cb progress_cb,
168+
git_indexer_progress_cb progress_cb,
169169
void *progress_cb_payload);
170170

171171
/**

include/git2/remote.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -516,7 +516,7 @@ struct git_remote_callbacks {
516516
* called with the current count of progress done by the
517517
* indexer.
518518
*/
519-
git_transfer_progress_cb transfer_progress;
519+
git_indexer_progress_cb transfer_progress;
520520

521521
/**
522522
* Each time a reference is updated locally, this function
@@ -832,7 +832,7 @@ GIT_EXTERN(int) git_remote_push(git_remote *remote,
832832
/**
833833
* Get the statistics structure that is filled in by the fetch operation.
834834
*/
835-
GIT_EXTERN(const git_transfer_progress *) git_remote_stats(git_remote *remote);
835+
GIT_EXTERN(const git_indexer_progress *) git_remote_stats(git_remote *remote);
836836

837837
/**
838838
* Retrieve the tag auto-follow setting

include/git2/sys/odb_backend.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ struct git_odb_backend {
8282

8383
int GIT_CALLBACK(writepack)(
8484
git_odb_writepack **, git_odb_backend *, git_odb *odb,
85-
git_transfer_progress_cb progress_cb, void *progress_payload);
85+
git_indexer_progress_cb progress_cb, void *progress_payload);
8686

8787
/**
8888
* "Freshens" an already existing object, updating its last-used

0 commit comments

Comments
 (0)