Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix submodule filtering bug in git_config #4339

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions easybuild/tools/filetools.py
Original file line number Diff line number Diff line change
Expand Up @@ -2683,11 +2683,13 @@ def get_source_tarball_from_git(filename, targetdir, git_config):
# if a specific commit is asked for, check it out
if commit:
checkout_cmd = [git_cmd, 'checkout', commit]
if recursive:
checkout_cmd.extend(['&&', git_cmd, 'submodule', 'update', '--init', '--recursive'])
elif recurse_submodules:

if recursive or recurse_submodules:
checkout_cmd.extend(['&&', git_cmd, 'submodule', 'update', '--init'])
checkout_cmd.extend(["--recurse-submodules='%s'" % pat for pat in recurse_submodules])
if recursive:
checkout_cmd.append('--recursive')
if recurse_submodules:
checkout_cmd.extend(["--recurse-submodules='%s'" % pat for pat in recurse_submodules])

run.run_cmd(' '.join(checkout_cmd), log_all=True, simple=True, regexp=False, path=repo_name)

Expand Down
13 changes: 13 additions & 0 deletions test/framework/filetools.py
Original file line number Diff line number Diff line change
Expand Up @@ -2857,7 +2857,20 @@ def run_check():
]) % git_repo
run_check()

git_config['recurse_submodules'] = ['!vcflib', '!sdsl-lite']
expected = '\n'.join([
r' running command "git clone --no-checkout %(git_repo)s"',
r" \(in .*/tmp.*\)",
' running command "git checkout 8456f86 && git submodule update --init --recursive'
+ ' --recurse-submodules=\'!vcflib\' --recurse-submodules=\'!sdsl-lite\'"',
r" \(in testrepository\)",
r' running command "tar cfvz .*/target/test.tar.gz --exclude .git testrepository"',
r" \(in .*/tmp.*\)",
]) % git_repo
run_check()

del git_config['recursive']
del git_config['recurse_submodules']
expected = '\n'.join([
r' running command "git clone --no-checkout %(git_repo)s"',
r" \(in .*/tmp.*\)",
Expand Down
Loading