Browse Source

use list() to change fs_paths to list (#887)

using `list()` to format fs_paths will not only access type `str` but also access type `tuple` and type `set`.
DedSecer 3 years ago
parent
commit
039c5e5eda
1 changed files with 3 additions and 1 deletions
  1. 3 1
      dulwich/repo.py

+ 3 - 1
dulwich/repo.py

@@ -1262,8 +1262,10 @@ class Repo(BaseRepo):
 
         root_path_bytes = os.fsencode(self.path)
 
-        if not isinstance(fs_paths, list):
+        if isinstance(fs_paths, str):
             fs_paths = [fs_paths]
+        fs_paths = list(fs_paths)
+
         from dulwich.index import (
             blob_from_path_and_stat,
             index_entry_from_stat,