10000 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
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( 52FE ' ')[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