Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'pack-bitmap.c')
-rw-r--r--pack-bitmap.c29
1 files changed, 24 insertions, 5 deletions
diff --git a/pack-bitmap.c b/pack-bitmap.c
index f9848e1b2a..d999616c9e 100644
--- a/pack-bitmap.c
+++ b/pack-bitmap.c
@@ -530,6 +530,22 @@ static int should_include(struct commit *commit, void *_data)
return 1;
}
+static int should_include_obj(struct object *obj, void *_data)
+{
+ struct include_data *data = _data;
+ int bitmap_pos;
+
+ bitmap_pos = bitmap_position(data->bitmap_git, &obj->oid);
+ if (bitmap_pos < 0)
+ return 1;
+ if ((data->seen && bitmap_get(data->seen, bitmap_pos)) ||
+ bitmap_get(data->base, bitmap_pos)) {
+ obj->flags |= SEEN;
+ return 0;
+ }
+ return 1;
+}
+
static int add_commit_to_bitmap(struct bitmap_index *bitmap_git,
struct bitmap **base,
struct commit *commit)
@@ -625,6 +641,7 @@ static struct bitmap *find_objects(struct bitmap_index *bitmap_git,
incdata.seen = seen;
revs->include_check = should_include;
+ revs->include_check_obj = should_include_obj;
revs->include_check_data = &incdata;
if (prepare_revision_walk(revs))
@@ -638,6 +655,7 @@ static struct bitmap *find_objects(struct bitmap_index *bitmap_git,
&show_data, NULL);
revs->include_check = NULL;
+ revs->include_check_obj = NULL;
revs->include_check_data = NULL;
}
@@ -796,8 +814,9 @@ static void filter_bitmap_exclude_type(struct bitmap_index *bitmap_git,
tips = find_tip_objects(bitmap_git, tip_objects, type);
/*
- * We can use the blob type-bitmap to work in whole words
- * for the objects that are actually in the bitmapped packfile.
+ * We can use the type-level bitmap for 'type' to work in whole
+ * words for the objects that are actually in the bitmapped
+ * packfile.
*/
for (i = 0, init_type_iterator(&it, bitmap_git, type);
i < to_filter->word_alloc && ewah_iterator_next(&mask, &it);
@@ -808,9 +827,9 @@ static void filter_bitmap_exclude_type(struct bitmap_index *bitmap_git,
}
/*
- * Clear any blobs that weren't in the packfile (and so would not have
- * been caught by the loop above. We'll have to check them
- * individually.
+ * Clear any objects that weren't in the packfile (and so would
+ * not have been caught by the loop above. We'll have to check
+ * them individually.
*/
for (i = 0; i < eindex->count; i++) {
uint32_t pos = i + bitmap_git->pack->num_objects;