* The `path=<path>` shows the path of the missing object inferred from a
containing object. A path containing SP or special characters is enclosed in
double-quotes in the C style as needed.
++
+* The `type=<type>` shows the type of the missing object inferred from a
+ containing object.
--
+
If some tips passed to the traversal are missing, they will be
struct missing_objects_map_entry {
struct oidmap_entry entry;
const char *path;
+ unsigned type;
};
static struct oidmap missing_objects;
enum missing_action {
return size;
}
-static void add_missing_object_entry(struct object_id *oid, const char *path)
+static void add_missing_object_entry(struct object_id *oid, const char *path,
+ unsigned type)
{
struct missing_objects_map_entry *entry;
CALLOC_ARRAY(entry, 1);
entry->entry.oid = *oid;
+ entry->type = type;
if (path)
entry->path = xstrdup(path);
oidmap_put(&missing_objects, entry);
strbuf_release(&path);
}
+ if (entry->type)
+ strbuf_addf(&sb, " type=%s", type_name(entry->type));
printf("?%s%s\n", oid_to_hex(&entry->entry.oid), sb.buf);
strbuf_release(&sb);
case MA_PRINT:
case MA_PRINT_INFO:
- add_missing_object_entry(&obj->oid, name);
+ add_missing_object_entry(&obj->oid, name, obj->type);
return;
case MA_ALLOW_PROMISOR:
/* Add missing tips */
while ((oid = oidset_iter_next(&iter)))
- add_missing_object_entry(oid, NULL);
+ add_missing_object_entry(oid, NULL, 0);
oidset_clear(&revs.missing_commits);
}
oid="$(git rev-parse "$obj")" &&
path=".git/objects/$(test_oid_to_path $oid)" &&
+ type_info=" type=$(git cat-file -t $oid)" &&
case $obj in
HEAD:foo)
# get the expected oids.
git rev-list --objects --no-object-names \
HEAD ^"$obj" >expect.raw &&
- echo "?$oid$path_info" >>expect.raw &&
+ echo "?$oid$path_info$type_info" >>expect.raw &&
mv "$path" "$path.hidden" &&
git rev-list --objects --no-object-names \