2
0
Эх сурвалжийг харах

Activate the binary detection by default

As binary detection was turned off, all binary files were given to the
line-ending filter and ended up altered, showing as modified in status for
example.
Boris Feld 6 жил өмнө
parent
commit
19cc89b435

+ 2 - 2
dulwich/line_ending.py

@@ -234,7 +234,7 @@ class BlobNormalizer(object):
         """
         if self.fallback_write_filter is not None:
             return normalize_blob(
-                blob, self.fallback_write_filter, binary_detection=False
+                blob, self.fallback_write_filter, binary_detection=True
             )
 
         return blob
@@ -244,7 +244,7 @@ class BlobNormalizer(object):
         """
         if self.fallback_read_filter is not None:
             return normalize_blob(
-                blob, self.fallback_read_filter, binary_detection=False
+                blob, self.fallback_read_filter, binary_detection=True
             )
 
         return blob

+ 3 - 1
dulwich/repo.py

@@ -1270,7 +1270,9 @@ class Repo(BaseRepo):
         """
         # TODO Parse the git attributes files
         git_attributes = {}
-        return BlobNormalizer(self.get_config_stack(), git_attributes)
+        return BlobNormalizer(
+            self.get_config_stack(), git_attributes
+        )
 
 
 class MemoryRepo(BaseRepo):