| 3710 | } |
| 3711 | |
| 3712 | int diff_filespec_is_binary(struct repository *r, |
| 3713 | struct diff_filespec *one) |
| 3714 | { |
| 3715 | struct diff_populate_filespec_options dpf_options = { |
| 3716 | .check_binary = 1, |
| 3717 | }; |
| 3718 | |
| 3719 | if (one->is_binary == -1) { |
| 3720 | diff_filespec_load_driver(one, r->index); |
| 3721 | if (one->driver->binary != -1) |
| 3722 | one->is_binary = one->driver->binary; |
| 3723 | else { |
| 3724 | if (!one->data && DIFF_FILE_VALID(one)) |
| 3725 | diff_populate_filespec(r, one, &dpf_options); |
| 3726 | if (one->is_binary == -1 && one->data) |
| 3727 | one->is_binary = buffer_is_binary(one->data, |
| 3728 | one->size); |
| 3729 | if (one->is_binary == -1) |
| 3730 | one->is_binary = 0; |
| 3731 | } |
| 3732 | } |
| 3733 | return one->is_binary; |
| 3734 | } |
| 3735 | |
| 3736 | static const struct userdiff_funcname * |
| 3737 | diff_funcname_pattern(struct diff_options *o, struct diff_filespec *one) |
no test coverage detected