MCPcopy Index your code
hub / github.com/git/git / diff_filespec_is_binary

Function diff_filespec_is_binary

diff.c:3712–3734  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3710}
3711
3712int 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
3736static const struct userdiff_funcname *
3737diff_funcname_pattern(struct diff_options *o, struct diff_filespec *one)

Callers 7

hash_charsFunction · 0.85
pickaxe_matchFunction · 0.85
builtin_diffFunction · 0.85
builtin_diffstatFunction · 0.85
builtin_checkdiffFunction · 0.85
fill_metainfoFunction · 0.85
diff_get_patch_idFunction · 0.85

Calls 3

diff_populate_filespecFunction · 0.85
buffer_is_binaryFunction · 0.85

Tested by

no test coverage detected