handle encoding error when checking .gitignore

This commit is contained in:
Paul Gauthier 2023-11-03 08:12:01 -07:00
parent f3d3815201
commit c4f6ce6435

View file

@ -86,7 +86,7 @@ def check_gitignore(git_root, io, ask=True):
gitignore_file = Path(git_root) / ".gitignore"
if gitignore_file.exists():
content = io.read_text(gitignore_file)
if pat in content.splitlines():
if content and pat in content.splitlines():
return
else:
content = ""