From b2ce25703f77f52ada632d0ddc33e9f3acd3f901 Mon Sep 17 00:00:00 2001 From: Ilya Kulakov Date: Mon, 13 Aug 2018 18:45:20 -0700 Subject: [PATCH] Use the -z option to avoid extra quotes in git's output. --- git_archive_all.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/git_archive_all.py b/git_archive_all.py index 5c0ffd2..46a1c33 100755 --- a/git_archive_all.py +++ b/git_archive_all.py @@ -210,15 +210,11 @@ def walk_git_files(self, repo_path=''): """ repo_abspath = path.join(self.main_repo_abspath, repo_path) repo_file_paths = self.run_git_shell( - 'git ls-files --cached --full-name --no-empty-directory', + 'git ls-files -z --cached --full-name --no-empty-directory', repo_abspath - ).splitlines() + ).split('\0')[:-1] for repo_file_path in repo_file_paths: - # Git quotes output if it contains non-ASCII or otherwise problematic characters as ". - if repo_file_path.startswith('"') and repo_file_path.endswith('"'): - repo_file_path = repo_file_path[1:-1] - repo_file_abspath = path.join(repo_abspath, repo_file_path) # absolute file path main_repo_file_path = path.join(repo_path, repo_file_path) # file path relative to the main repo