Skip to content

Commit

Permalink
Change get_commits_since so that it won't take commits from other bra…
Browse files Browse the repository at this point in the history
…nches (#12376)
  • Loading branch information
alopezz authored Jun 16, 2022
1 parent 549d9e0 commit cfd1625
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
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

0 comments on commit cfd1625

Please sign in to comment.