Skip to content
This repository has been archived by the owner on Apr 20, 2023. It is now read-only.

Commit

Permalink
Merge pull request #118 from blueyed/better-merge-detect
Browse files Browse the repository at this point in the history
Improve detection of merge commits
  • Loading branch information
Steve Peak committed Dec 18, 2017
2 parents 022c043 + 6c7e07a commit 2a9018a
Showing 1 changed file with 5 additions and 5 deletions.
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 comments on commit 2a9018a

Please sign in to comment.