8000 Fix handling of merge commits: only for PRs · Kami/codecov-python@e163777 · GitHub
[go: up one dir, main page]

Skip to content

Commit e163777

Browse files
committed
Fix handling of merge commits: only for PRs
Ref: codecov/codecov-bash#106
1 parent 2235d62 commit e163777

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

codecov/__init__.py

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -527,27 +527,28 @@ def main(*argv, **kwargs):
527527
if codecov.build:
528528
query['build'] = codecov.build
529529

530+
if codecov.pr:
531+
query['pr'] = codecov.pr
532+
530533
if codecov.commit:
531534
query['commit'] = codecov.commit
532535

533-
else:
536+
elif query['pr'] and query['pr'] != 'false':
534537
# Merge Commits
535538
# -------------
536539
res = try_to_run('git show --no-patch --format="%P"')
537540
if res:
538541
heads = res.split(' ')
539542
if len(heads) > 1:
540543
query['commit'] = heads[0]
544+
write(' Fixing merge commit SHA')
541545

542546
if codecov.slug:
543547
query['slug'] = codecov.slug
544548

545549
if codecov.branch:
546550
query['branch'] = codecov.branch
547551

548-
if codecov.pr:
549-
query['pr'] = codecov.pr
550-
551552
if codecov.tag:
552553
query['tag'] = codecov.tag
553554

0 commit comments

Comments
 (0)
0