aboutsummaryrefslogtreecommitdiffstats
path: root/builtin/rev-list.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin/rev-list.c')
-rw-r--r--builtin/rev-list.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/builtin/rev-list.c b/builtin/rev-list.c
index 1e2b0a81e8..bb26bee0d4 100644
--- a/builtin/rev-list.c
+++ b/builtin/rev-list.c
@@ -79,6 +79,7 @@ static int arg_print_omitted; /* print objects omitted by filter */
struct missing_objects_map_entry {
struct oidmap_entry entry;
const char *path;
+ unsigned type;
};
static struct oidmap missing_objects;
enum missing_action {
@@ -109,7 +110,8 @@ static off_t get_object_disk_usage(struct object *obj)
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;
@@ -118,6 +120,7 @@ static void add_missing_object_entry(struct object_id *oid, const char *path)
CALLOC_ARRAY(entry, 1);
entry->entry.oid = *oid;
+ entry->type = type;
if (path)
entry->path = xstrdup(path);
oidmap_put(&missing_objects, entry);
@@ -142,6 +145,8 @@ static void print_missing_object(struct missing_objects_map_entry *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);
@@ -166,7 +171,7 @@ static inline void finish_object__ma(struct object *obj, const char *name)
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:
@@ -843,7 +848,7 @@ int cmd_rev_list(int argc,
/* 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);
}