Make explicit argument for git commit -a

This commit is contained in:
Chris Hunt 2020-01-03 19:21:36 -05:00
parent f9bf1a7004
commit 5665b94a5b
2 changed files with 13 additions and 3 deletions

View File

@ -717,7 +717,12 @@ def _create_main_file(dir_path, name=None, output=None):
def _git_commit(
env_or_script, repo_dir, message=None, args=None, allow_empty=False
env_or_script,
repo_dir,
message=None,
args=None,
allow_empty=False,
stage_modified=False,
):
"""
Run git-commit.
@ -736,6 +741,9 @@ def _git_commit(
if allow_empty:
args.append("--allow-empty")
if stage_modified:
args.append("--all")
new_args = [
'git', 'commit', '-q', '--author', 'pip <pypa-dev@googlegroups.com>',
]
@ -880,7 +888,7 @@ def _change_test_package_version(script, version_pkg_path):
)
# Pass -a to stage the change to the main file.
_git_commit(
script, version_pkg_path, message='messed version', args=['-a']
script, version_pkg_path, message='messed version', stage_modified=True
)

View File

@ -31,7 +31,9 @@ def _pull_in_submodule_changes_to_module(env, module_path, rel_path):
submodule_path = module_path / rel_path
env.run('git', 'pull', '-q', 'origin', 'master', cwd=submodule_path)
# Pass -a to stage the submodule changes that were just pulled in.
_git_commit(env, module_path, message='submodule change', args=['-a'])
_git_commit(
env, module_path, message='submodule change', stage_modified=True
)
def _create_test_package_with_submodule(env, rel_path):