소스 검색

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 년 전
부모
커밋
19cc89b435
2개의 변경된 파일5개의 추가작업 그리고 3개의 파일을 삭제
  1. 2 2
      dulwich/line_ending.py
  2. 3 1
      dulwich/repo.py

+ 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):