Skip to content

Commit

Permalink
Fix excludes for files in submodules
Browse files Browse the repository at this point in the history
  • Loading branch information
alehaa committed Jan 19, 2018
1 parent b007547 commit b9a4d27
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions git_archive_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,12 +326,14 @@ def walk_git_files(self, repo_path=''):

if m:
submodule_path = m.group(1)
submodule_abspath = path.join(repo_path, submodule_path)

if self.is_file_excluded(repo_abspath, submodule_path, exclude_patterns):
continue
submodule_path = path.join(repo_path, submodule_path)

for submodule_file_path in self.walk_git_files(submodule_path):
if self.is_file_excluded(repo_abspath, submodule_file_path, exclude_patterns):
for submodule_file_path in self.walk_git_files(submodule_abspath):
rel_file_path = submodule_file_path.replace(repo_path, "", 1).strip("/")
if self.is_file_excluded(repo_abspath, rel_file_path, exclude_patterns):
continue

yield submodule_file_path
Expand Down

0 comments on commit b9a4d27

Please sign in to comment.