mirror of
https://github.com/git-for-windows/git.git
synced 2026-04-16 20:44:52 -05:00
Revert "Merge branch 'jt/path-filter-fix' into next"
This reverts commitd99958c287, reversing changes made to996db74865.
This commit is contained in:
@@ -304,26 +304,17 @@ static int graph_read_oid_lookup(const unsigned char *chunk_start,
|
||||
return 0;
|
||||
}
|
||||
|
||||
struct graph_read_bloom_data_context {
|
||||
struct commit_graph *g;
|
||||
int *commit_graph_changed_paths_version;
|
||||
};
|
||||
|
||||
static int graph_read_bloom_data(const unsigned char *chunk_start,
|
||||
size_t chunk_size, void *data)
|
||||
{
|
||||
struct graph_read_bloom_data_context *c = data;
|
||||
struct commit_graph *g = c->g;
|
||||
struct commit_graph *g = data;
|
||||
uint32_t hash_version;
|
||||
g->chunk_bloom_data = chunk_start;
|
||||
hash_version = get_be32(chunk_start);
|
||||
|
||||
if (*c->commit_graph_changed_paths_version == -1) {
|
||||
*c->commit_graph_changed_paths_version = hash_version;
|
||||
} else if (hash_version != *c->commit_graph_changed_paths_version) {
|
||||
if (hash_version != 1)
|
||||
return 0;
|
||||
}
|
||||
|
||||
g->chunk_bloom_data = chunk_start;
|
||||
g->bloom_filter_settings = xmalloc(sizeof(struct bloom_filter_settings));
|
||||
g->bloom_filter_settings->hash_version = hash_version;
|
||||
g->bloom_filter_settings->num_hashes = get_be32(chunk_start + 4);
|
||||
@@ -410,15 +401,11 @@ struct commit_graph *parse_commit_graph(struct repo_settings *s,
|
||||
graph->read_generation_data = 1;
|
||||
}
|
||||
|
||||
if (s->commit_graph_changed_paths_version) {
|
||||
struct graph_read_bloom_data_context context = {
|
||||
.g = graph,
|
||||
.commit_graph_changed_paths_version = &s->commit_graph_changed_paths_version
|
||||
};
|
||||
if (s->commit_graph_read_changed_paths) {
|
||||
pair_chunk(cf, GRAPH_CHUNKID_BLOOMINDEXES,
|
||||
&graph->chunk_bloom_indexes);
|
||||
read_chunk(cf, GRAPH_CHUNKID_BLOOMDATA,
|
||||
graph_read_bloom_data, &context);
|
||||
graph_read_bloom_data, graph);
|
||||
}
|
||||
|
||||
if (graph->chunk_bloom_indexes && graph->chunk_bloom_data) {
|
||||
@@ -2401,14 +2388,6 @@ int write_commit_graph(struct object_directory *odb,
|
||||
ctx->write_generation_data = (get_configured_generation_version(r) == 2);
|
||||
ctx->num_generation_data_overflows = 0;
|
||||
|
||||
if (r->settings.commit_graph_changed_paths_version < -1
|
||||
|| r->settings.commit_graph_changed_paths_version > 2) {
|
||||
warning(_("attempting to write a commit-graph, but 'commitgraph.changedPathsVersion' (%d) is not supported"),
|
||||
r->settings.commit_graph_changed_paths_version);
|
||||
return 0;
|
||||
}
|
||||
bloom_settings.hash_version = r->settings.commit_graph_changed_paths_version == 2
|
||||
? 2 : 1;
|
||||
bloom_settings.bits_per_entry = git_env_ulong("GIT_TEST_BLOOM_SETTINGS_BITS_PER_ENTRY",
|
||||
bloom_settings.bits_per_entry);
|
||||
bloom_settings.num_hashes = git_env_ulong("GIT_TEST_BLOOM_SETTINGS_NUM_HASHES",
|
||||
@@ -2438,7 +2417,7 @@ int write_commit_graph(struct object_directory *odb,
|
||||
g = ctx->r->objects->commit_graph;
|
||||
|
||||
/* We have changed-paths already. Keep them in the next graph */
|
||||
if (g && g->bloom_filter_settings) {
|
||||
if (g && g->chunk_bloom_data) {
|
||||
ctx->changed_paths = 1;
|
||||
ctx->bloom_settings = g->bloom_filter_settings;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user