diff options
Diffstat (limited to 'builtin/cat-file.c')
| -rw-r--r-- | builtin/cat-file.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/builtin/cat-file.c b/builtin/cat-file.c index 0e2176c449..bcceb646f8 100644 --- a/builtin/cat-file.c +++ b/builtin/cat-file.c @@ -482,7 +482,8 @@ static void batch_object_write(const char *obj_name, if (!data->skip_object_info) { int ret; - if (use_mailmap) + if (use_mailmap || + opt->objects_filter.choice == LOFC_BLOB_NONE) data->info.typep = &data->type; if (pack) @@ -500,6 +501,14 @@ static void batch_object_write(const char *obj_name, switch (opt->objects_filter.choice) { case LOFC_DISABLED: break; + case LOFC_BLOB_NONE: + if (data->type == OBJ_BLOB) { + if (!opt->all_objects) + report_object_status(opt, obj_name, + &data->oid, "excluded"); + return; + } + break; default: BUG("unsupported objects filter"); } @@ -1039,6 +1048,10 @@ int cmd_cat_file(int argc, switch (batch.objects_filter.choice) { case LOFC_DISABLED: break; + case LOFC_BLOB_NONE: + if (!batch.enabled) + usage(_("objects filter only supported in batch mode")); + break; default: usagef(_("objects filter not supported: '%s'"), list_object_filter_config_name(batch.objects_filter.choice)); |
