commit - 857fde73cee7d4df6f410f2bdfa837b17b78d3ec
commit + 78a0087665b219f344e9aa2a9cd40bedb63d0f58
blob - 74811470eff0f6d9a213faf7d3d7a576fda88883
blob + d2ad520451a26816928ff1b63ae309b790b46595
--- lib/pack_create.c
+++ lib/pack_create.c
static const struct got_error *
add_object(int want_meta, struct got_object_idset *idset,
struct got_object_id *id, const char *path, int obj_type,
- time_t mtime, int loose_obj_only, struct got_repository *repo)
+ time_t mtime, int loose_obj_only, struct got_repository *repo,
+ int *ncolored, int *nfound, int *ntrees,
+ got_pack_progress_cb progress_cb, void *progress_arg,
+ struct got_ratelimit *rl)
{
const struct got_error *err;
struct got_pack_meta *m = NULL;
if (want_meta) {
err = alloc_meta(&m, id, path, obj_type, mtime);
+ if (err)
+ return err;
+
+ (*nfound)++;
+ err = report_progress(progress_cb, progress_arg, rl,
+ *ncolored, *nfound, *ntrees, 0L, 0, 0, 0, 0);
if (err)
return err;
}
STAILQ_INSERT_TAIL(ids, qid, entry);
} else if (S_ISREG(mode) || S_ISLNK(mode)) {
err = add_object(want_meta, idset, id, p,
- GOT_OBJ_TYPE_BLOB, mtime, loose_obj_only, repo);
+ GOT_OBJ_TYPE_BLOB, mtime, loose_obj_only, repo,
+ ncolored, nfound, ntrees,
+ progress_cb, progress_arg, rl);
if (err)
break;
- if (want_meta) {
- (*nfound)++;
- err = report_progress(progress_cb, progress_arg,
- rl, *ncolored, *nfound, *ntrees,
- 0L, 0, 0, 0, 0);
- if (err)
- break;
- }
}
free(p);
p = NULL;
}
err = add_object(want_meta, idset, qid->id, dpath,
- GOT_OBJ_TYPE_TREE, mtime, loose_obj_only, repo);
+ GOT_OBJ_TYPE_TREE, mtime, loose_obj_only, repo,
+ ncolored, nfound, ntrees, progress_cb, progress_arg, rl);
if (err) {
got_object_qid_free(qid);
break;
}
- if (want_meta) {
- (*nfound)++;
- err = report_progress(progress_cb, progress_arg, rl,
- *ncolored, *nfound, *ntrees, 0L, 0, 0, 0, 0);
- if (err)
- break;
- }
-
err = load_tree_entries(&tree_ids, want_meta, idset, qid->id,
dpath, mtime, repo, loose_obj_only, ncolored, nfound,
ntrees, progress_cb, progress_arg, rl,
err = add_object(want_meta, idset, id, "", GOT_OBJ_TYPE_COMMIT,
got_object_commit_get_committer_time(commit),
- loose_obj_only, repo);
+ loose_obj_only, repo,
+ ncolored, nfound, ntrees, progress_cb, progress_arg, rl);
if (err)
goto done;
-
- if (want_meta) {
- (*nfound)++;
- err = report_progress(progress_cb, progress_arg, rl,
- *ncolored, *nfound, *ntrees, 0L, 0, 0, 0, 0);
- if (err)
- goto done;
- }
err = load_tree(want_meta, idset, got_object_commit_get_tree_id(commit),
"", got_object_commit_get_committer_time(commit),
return err;
err = add_object(want_meta, idset, id, "", GOT_OBJ_TYPE_TAG,
- got_object_tag_get_tagger_time(tag),
- loose_obj_only, repo);
+ got_object_tag_get_tagger_time(tag), loose_obj_only, repo,
+ ncolored, nfound, ntrees, progress_cb, progress_arg, rl);
if (err)
goto done;
- if (want_meta) {
- (*nfound)++;
- err = report_progress(progress_cb, progress_arg, rl,
- *ncolored, *nfound, *ntrees, 0L, 0, 0, 0, 0);
- if (err)
- goto done;
- }
-
switch (got_object_tag_get_object_type(tag)) {
case GOT_OBJ_TYPE_COMMIT:
err = load_commit(want_meta, idset,