소스 검색

For a symlink, stat.st_size is 0 on windows.

Gary van der Merwe 10 년 전
부모
커밋
181426e839
1개의 변경된 파일5개의 추가작업 그리고 2개의 파일을 삭제
  1. 5 2
      dulwich/tests/test_index.py

+ 5 - 2
dulwich/tests/test_index.py

@@ -25,6 +25,7 @@ import os
 import shutil
 import stat
 import struct
+import sys
 import tempfile
 
 from dulwich.index import (
@@ -386,8 +387,10 @@ class BuildIndexTests(TestCase):
             # symlink to d
             epath = os.path.join(repo.path, 'c', 'e')
             self.assertTrue(os.path.exists(epath))
-            self.assertReasonableIndexEntry(index[b'c/e'],
-                stat.S_IFLNK, 1, filee.id)
+            self.assertReasonableIndexEntry(
+                index[b'c/e'], stat.S_IFLNK,
+                0 if sys.platform == 'win32' else 1,
+                filee.id)
             self.assertFileContents(epath, 'd', symlink=True)
 
 class GetUnstagedChangesTests(TestCase):