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

Change get_commits_since so that it won't take commits from other branches #12376

Merged
merged 1 commit into from
Jun 16, 2022
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
2 changes: 1 addition & 1 deletion datadog_checks_dev/datadog_checks/dev/tooling/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ def get_commits_since(check_name, target_tag=None, end=None, exclude_branch=None
elif exclude_branch is not None:
command = f"git cherry -v {exclude_branch} HEAD {'' if target_tag is None else f'{target_tag} '}"
else:
command = f"git log --pretty=%s {'' if target_tag is None else f'{target_tag}...{end} '}{target_path}"
command = f"git log --pretty=%s {'' if target_tag is None else f'{target_tag}..{end} '}{target_path}"

with chdir(root):
return run_command(command, capture=True, check=True).stdout.splitlines()
Expand Down
2 changes: 1 addition & 1 deletion datadog_checks_dev/tests/tooling/test_git.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ def test_get_commits_since():
chdir.assert_called_once_with('/foo/')
get_commits_since('my-check', target_tag='the-tag')
run.assert_any_call('git log --pretty=%s /foo/my-check', capture=True, check=True)
run.assert_any_call('git log --pretty=%s the-tag... /foo/my-check', capture=True, check=True)
run.assert_any_call('git log --pretty=%s the-tag.. /foo/my-check', capture=True, check=True)


def test_git_show_file():
Expand Down