Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-09-13 01:47:15 +0400
committerRussell Belfer <rb@github.com>2013-09-17 20:31:45 +0400
commit0e32635fcf9a874fe66f871e88c0bbc0511544f1 (patch)
treefacf17365a25e8eaaa5beb277c738051e02a7a32 /src/crlf.c
parenta9f51e430fef49b3299ec33c11a4e6623e3f58cc (diff)
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
Diffstat (limited to 'src/crlf.c')
-rw-r--r--src/crlf.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/crlf.c b/src/crlf.c
index bde85ca06..6b1fe46a3 100644
--- a/src/crlf.c
+++ b/src/crlf.c
@@ -209,6 +209,10 @@ static int crlf_apply_to_workdir(
if (git_buf_len(from) == 0)
return 0;
+ /* Don't filter binary files */
+ if (git_buf_text_is_binary(from))
+ return GIT_ENOTFOUND;
+
/* Determine proper line ending */
workdir_ending = line_ending(ca);
if (!workdir_ending)