Sfoglia il codice sorgente

Merge pull request #1002 from aufarg/patch

filetime_from_git: Fix arguments encoding
Justin Mayer 6 anni fa
parent
commit
7ee0537922
1 ha cambiato i file con 5 aggiunte e 5 eliminazioni
  1. 5 5
      filetime_from_git/git_wrapper.py

+ 5 - 5
filetime_from_git/git_wrapper.py

@@ -39,7 +39,7 @@ class _GitWrapperCommon(object):
         :returns: True if path is managed by git
         '''
         status, _stdout, _stderr = self.git.execute(
-            ['git', 'ls-files', path.encode('utf-8'), '--error-unmatch'],
+            ['git', 'ls-files', path, '--error-unmatch'],
             with_extended_output=True,
             with_exceptions=False)
         return status == 0
@@ -51,7 +51,7 @@ class _GitWrapperCommon(object):
         :returns: True if file has local changes
         '''
         status, _stdout, _stderr = self.git.execute(
-            ['git', 'diff', '--quiet', 'HEAD', path.encode('utf-8')],
+            ['git', 'diff', '--quiet', 'HEAD', path],
             with_extended_output=True,
             with_exceptions=False)
         return status != 0
@@ -77,7 +77,7 @@ class _GitWrapperCommon(object):
             '--follow',
             '--name-only',
             '--',
-            path.encode('utf-8')).splitlines()
+            path).splitlines()
 
         for commit_sha, _, filename in grouper(log_result, 3):
             yield self.repo.commit(commit_sha), filename
@@ -106,7 +106,7 @@ class _GitWrapperLegacy(_GitWrapperCommon):
 
         :returns: Sequence of commit objects. Newest to oldest
         '''
-        return self.repo.commits(path=path.encode('utf-8'))
+        return self.repo.commits(path=path)
 
     @staticmethod
     def get_commit_date(commit, tz_name):
@@ -133,7 +133,7 @@ class _GitWrapper(_GitWrapperCommon):
 
             Alternatively enabling GIT_FILETIME_FOLLOW may also make your problem go away.
         '''
-        return list(self.repo.iter_commits(paths=path.encode('utf-8')))
+        return list(self.repo.iter_commits(paths=path))
 
     @staticmethod
     def get_commit_date(commit, tz_name):