зеркало из https://github.com/microsoft/git.git
Merge branch 'sg/commit-graph-progress-fix' into master
The code to produce progress output from "git commit-graph --write" had a few breakages, which have been fixed. * sg/commit-graph-progress-fix: commit-graph: fix "Writing out commit graph" progress counter commit-graph: fix progress of reachable commits
This commit is contained in:
Коммит
12f5eb9f08
|
@ -1149,23 +1149,14 @@ static void write_graph_chunk_bloom_indexes(struct hashfile *f,
|
||||||
struct commit **list = ctx->commits.list;
|
struct commit **list = ctx->commits.list;
|
||||||
struct commit **last = ctx->commits.list + ctx->commits.nr;
|
struct commit **last = ctx->commits.list + ctx->commits.nr;
|
||||||
uint32_t cur_pos = 0;
|
uint32_t cur_pos = 0;
|
||||||
struct progress *progress = NULL;
|
|
||||||
int i = 0;
|
|
||||||
|
|
||||||
if (ctx->report_progress)
|
|
||||||
progress = start_delayed_progress(
|
|
||||||
_("Writing changed paths Bloom filters index"),
|
|
||||||
ctx->commits.nr);
|
|
||||||
|
|
||||||
while (list < last) {
|
while (list < last) {
|
||||||
struct bloom_filter *filter = get_bloom_filter(ctx->r, *list, 0);
|
struct bloom_filter *filter = get_bloom_filter(ctx->r, *list, 0);
|
||||||
cur_pos += filter->len;
|
cur_pos += filter->len;
|
||||||
display_progress(progress, ++i);
|
display_progress(ctx->progress, ++ctx->progress_cnt);
|
||||||
hashwrite_be32(f, cur_pos);
|
hashwrite_be32(f, cur_pos);
|
||||||
list++;
|
list++;
|
||||||
}
|
}
|
||||||
|
|
||||||
stop_progress(&progress);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void write_graph_chunk_bloom_data(struct hashfile *f,
|
static void write_graph_chunk_bloom_data(struct hashfile *f,
|
||||||
|
@ -1174,13 +1165,6 @@ static void write_graph_chunk_bloom_data(struct hashfile *f,
|
||||||
{
|
{
|
||||||
struct commit **list = ctx->commits.list;
|
struct commit **list = ctx->commits.list;
|
||||||
struct commit **last = ctx->commits.list + ctx->commits.nr;
|
struct commit **last = ctx->commits.list + ctx->commits.nr;
|
||||||
struct progress *progress = NULL;
|
|
||||||
int i = 0;
|
|
||||||
|
|
||||||
if (ctx->report_progress)
|
|
||||||
progress = start_delayed_progress(
|
|
||||||
_("Writing changed paths Bloom filters data"),
|
|
||||||
ctx->commits.nr);
|
|
||||||
|
|
||||||
hashwrite_be32(f, settings->hash_version);
|
hashwrite_be32(f, settings->hash_version);
|
||||||
hashwrite_be32(f, settings->num_hashes);
|
hashwrite_be32(f, settings->num_hashes);
|
||||||
|
@ -1188,12 +1172,10 @@ static void write_graph_chunk_bloom_data(struct hashfile *f,
|
||||||
|
|
||||||
while (list < last) {
|
while (list < last) {
|
||||||
struct bloom_filter *filter = get_bloom_filter(ctx->r, *list, 0);
|
struct bloom_filter *filter = get_bloom_filter(ctx->r, *list, 0);
|
||||||
display_progress(progress, ++i);
|
display_progress(ctx->progress, ++ctx->progress_cnt);
|
||||||
hashwrite(f, filter->data, filter->len * sizeof(unsigned char));
|
hashwrite(f, filter->data, filter->len * sizeof(unsigned char));
|
||||||
list++;
|
list++;
|
||||||
}
|
}
|
||||||
|
|
||||||
stop_progress(&progress);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int oid_compare(const void *_a, const void *_b)
|
static int oid_compare(const void *_a, const void *_b)
|
||||||
|
@ -1423,12 +1405,13 @@ int write_commit_graph_reachable(struct object_directory *odb,
|
||||||
_("Collecting referenced commits"), 0);
|
_("Collecting referenced commits"), 0);
|
||||||
|
|
||||||
for_each_ref(add_ref_to_set, &data);
|
for_each_ref(add_ref_to_set, &data);
|
||||||
|
|
||||||
|
stop_progress(&data.progress);
|
||||||
|
|
||||||
result = write_commit_graph(odb, NULL, &commits,
|
result = write_commit_graph(odb, NULL, &commits,
|
||||||
flags, split_opts);
|
flags, split_opts);
|
||||||
|
|
||||||
oidset_clear(&commits);
|
oidset_clear(&commits);
|
||||||
if (data.progress)
|
|
||||||
stop_progress(&data.progress);
|
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Загрузка…
Ссылка в новой задаче