mirror of
https://github.com/newren/git-filter-repo.git
synced 2024-07-06 18:32:14 +02:00
filter-repo: allow FastExportFilter to take file-like objects
Signed-off-by: Elijah Newren <newren@gmail.com>
This commit is contained in:
parent
636a3cf575
commit
4fed91af18
@ -912,9 +912,12 @@ class FastExportFilter(object):
|
||||
# Sanity check arguments
|
||||
if len(args) != 0 and len(args) != 2:
|
||||
raise SystemExit("run() must be called with 0 or 2 arguments")
|
||||
for arg in args:
|
||||
if type(arg) != str and type(arg) != file:
|
||||
raise SystemExit("arguments to run() must be filenames or files")
|
||||
if type(args[0]) != str and not (
|
||||
hasattr(args[0], 'read') and hasattr(args[0], 'readline')):
|
||||
raise SystemExit("arguments to run() must be filenames or files")
|
||||
if type(args[1]) != str and not (
|
||||
hasattr(args[1], 'write') and hasattr(args[1], 'close')):
|
||||
raise SystemExit("arguments to run() must be filenames or files")
|
||||
|
||||
# Set input. If no args provided, use stdin.
|
||||
self._input = sys.stdin
|
||||
|
Loading…
Reference in New Issue
Block a user