8000 Improve detection of merge commits by blueyed · Pull Request #118 · codecov/codecov-python · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on May 21, 2025. It is now read-only.

Improve detection of merge commits #118

Merged
merged 1 commit into from
Dec 18, 2017
Merged
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
Improve detection of merge commits
This looks at the commit parents instead of parsing the Git commit subject.
  • Loading branch information
blueyed committed Oct 29, 2017
commit 6c7e07a3afc8189b913087fdc91bb3e91c9a92a0
10 changes: 5 additions & 5 deletions codecov/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,6 @@

remove_token = re.compile(r'token=[^\&]+').sub

is_merge_commit = re.compile(r'^Merge\s\w{40}\sinto\s\w{40}$')

ignored_path = re.compile(r'(/vendor)|'
r'(/js/generated/coverage)|'
r'(/__pycache__)|'
Expand Down Expand Up @@ -530,9 +528,11 @@ def main(*argv, **kwargs):
else:
# Merge Commits
# -------------
res = try_to_run('git log -1 --pretty=%B')
if res and is_merge_commit.match(res.strip()):
query['commit'] = res.split(' ')[1]
res = try_to_run('git show --no-patch --format="%P"')
if res:
heads = res.split(' ')
if len(heads) > 1:
query['commit'] = heads[0]

if codecov.slug:
query['slug'] = codecov.slug
Expand Down
0