Commit 0e32635f by Russell Belfer

Move binary check to CRLF filter itself

Checkout should not reject binary files from filters, as a filter
may actually wish to operate on binary files.  The CRLF filter should
reject binary files itself if it wishes to.  Moreover, the CRLF
filter requires this logic so that users can emulate the checkout
data in their odb -> workdir filtering.

Conflicts:
	src/checkout.c
	src/crlf.c
parent a9f51e43
...@@ -715,7 +715,7 @@ static int blob_content_to_file( ...@@ -715,7 +715,7 @@ static int blob_content_to_file(
git_buf out = GIT_BUF_INIT; git_buf out = GIT_BUF_INIT;
git_filter_list *fl = NULL; git_filter_list *fl = NULL;
if (!opts->disable_filters && !git_blob_is_binary(blob)) if (!opts->disable_filters)
error = git_filter_list_load( error = git_filter_list_load(
&fl, git_blob_owner(blob), blob, path, GIT_FILTER_TO_WORKTREE); &fl, git_blob_owner(blob), blob, path, GIT_FILTER_TO_WORKTREE);
......
...@@ -209,6 +209,10 @@ static int crlf_apply_to_workdir( ...@@ -209,6 +209,10 @@ static int crlf_apply_to_workdir(
if (git_buf_len(from) == 0) if (git_buf_len(from) == 0)
return 0; return 0;
/* Don't filter binary files */
if (git_buf_text_is_binary(from))
return GIT_ENOTFOUND;
/* Determine proper line ending */ /* Determine proper line ending */
workdir_ending = line_ending(ca); workdir_ending = line_ending(ca);
if (!workdir_ending) if (!workdir_ending)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment