Skip to content

Commit

Permalink
Merge pull request #41 from alehaa/bugfix/exclude-submodule
Browse files Browse the repository at this point in the history
Fix two-layer excludes
  • Loading branch information
Kentzo authored Feb 13, 2018
2 parents 136c766 + b9a4d27 commit 16a79f7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions git_archive_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -326,13 +326,14 @@ def walk_git_files(self, repo_path=''):

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

if self.is_file_excluded(repo_abspath, submodule_path, exclude_patterns):
continue

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 16a79f7

Please sign in to comment.