@@ -1534,7 +1534,7 @@ static void add_pbase_object(struct tree_desc *tree,
return;
if (name[cmplen] != '/') {
add_object_entry(&entry.oid,
- object_type(entry.mode),
+ entry.object_type,
fullname, 1);
return;
}
@@ -1314,7 +1314,7 @@ static struct object_list **process_tree(struct tree *tree,
init_tree_desc(&desc, tree->buffer, tree->size);
while (tree_entry(&desc, &entry))
- switch (object_type(entry.mode)) {
+ switch (entry.object_type) {
case OBJ_TREE:
p = process_tree(lookup_tree(the_repository, &entry.oid),
p);
@@ -1323,9 +1323,11 @@ static struct object_list **process_tree(struct tree *tree,
p = process_blob(lookup_blob(the_repository, &entry.oid),
p);
break;
- default:
+ case OBJ_COMMIT:
/* Subproject commit - not in this repository */
break;
+ default:
+ BUG("unreachable");
}
free_tree_buffer(tree);
@@ -353,7 +353,7 @@ static void fill_bitmap_tree(struct bitmap *bitmap,
init_tree_desc(&desc, tree->buffer, tree->size);
while (tree_entry(&desc, &entry)) {
- switch (object_type(entry.mode)) {
+ switch (entry.object_type) {
case OBJ_TREE:
fill_bitmap_tree(bitmap,
lookup_tree(the_repository, &entry.oid));
@@ -361,9 +361,11 @@ static void fill_bitmap_tree(struct bitmap *bitmap,
case OBJ_BLOB:
bitmap_set(bitmap, find_object_pos(&entry.oid));
break;
- default:
- /* Gitlink, etc; not reachable */
+ case OBJ_COMMIT:
+ /* submodule commit - not in this repository */
break;
+ default:
+ BUG("unreachable");
}
}
@@ -72,16 +72,18 @@ static void mark_tree_contents_uninteresting(struct repository *r,
init_tree_desc(&desc, tree->buffer, tree->size);
while (tree_entry(&desc, &entry)) {
- switch (object_type(entry.mode)) {
+ switch (entry.object_type) {
case OBJ_TREE:
mark_tree_uninteresting(r, lookup_tree(r, &entry.oid));
break;
case OBJ_BLOB:
mark_blob_uninteresting(lookup_blob(r, &entry.oid));
break;
- default:
+ case OBJ_COMMIT:
/* Subproject commit - not in this repository */
break;
+ default:
+ BUG("unreachable");
}
}
@@ -179,7 +181,7 @@ static void add_children_by_path(struct repository *r,
init_tree_desc(&desc, tree->buffer, tree->size);
while (tree_entry(&desc, &entry)) {
- switch (object_type(entry.mode)) {
+ switch (entry.object_type) {
case OBJ_TREE:
paths_and_oids_insert(map, entry.path, &entry.oid);
@@ -196,9 +198,11 @@ static void add_children_by_path(struct repository *r,
child->object.flags |= UNINTERESTING;
}
break;
- default:
+ case OBJ_COMMIT:
/* Subproject commit - not in this repository */
break;
+ default:
+ BUG("unreachable");
}
}
Change uses of object_type(entry.mode) to use the new entry.object_type field. Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com> --- builtin/pack-objects.c | 2 +- http-push.c | 6 ++++-- pack-bitmap-write.c | 8 +++++--- revision.c | 12 ++++++++---- 4 files changed, 18 insertions(+), 10 deletions(-)