From 6fe4ace58f39481375f5b3b78d7aa3152aef145d Mon Sep 17 00:00:00 2001 From: Ilya Kulakov Date: Tue, 14 Aug 2018 15:49:56 -0700 Subject: [PATCH] Use the -z option for check-attr to make test unambiguous. --- git_archive_all.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/git_archive_all.py b/git_archive_all.py index 3df7eae..9dbadc8 100755 --- a/git_archive_all.py +++ b/git_archive_all.py @@ -174,10 +174,14 @@ def is_file_excluded(self, repo_abspath, repo_file_path): @rtype: bool """ out = self.run_git_shell( - 'git check-attr export-ignore -- %s' % repo_file_path, + 'git check-attr -z export-ignore -- %s' % repo_file_path, cwd=repo_abspath - ) - return 'export-ignore: set' in out + ).split('\0') + + try: + return out[2] == 'set' + except IndexError: + return False def archive_all_files(self, archiver): """