8000 revert change from #118 · codecov/codecov-python@7f53af7 · 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.

Commit 7f53af7

Browse files
committed
revert change from #118
1 parent f6cd01a commit 7f53af7

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

codecov/__init__.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@
3434

3535
COLOR = True
3636

37+
is_merge_commit = re.compile(r'^Merge\s\w{40}\sinto\s\w{40}$')
38+
3739
remove_token = re.compile(r'token=[^\&]+').sub
3840

3941
ignored_path = re.compile(r'(/vendor)|'
@@ -522,12 +524,10 @@ def main(*argv, **kwargs):
522524
elif query['pr'] and query['pr'] != 'false':
523525
# Merge Commits
524526
# -------------
525-
res = try_to_run('git show --no-patch --format="%P"')
526-
if res:
527-
heads = res.split(' ')
528-
if len(heads) > 1:
529-
query['commit'] = heads[0]
530-
write(' Fixing merge commit SHA')
527+
res = try_to_run('git log -1 --pretty=%B')
528+
if res and is_merge_commit.match(res.strip()):
529+
query['commit'] = res.split(' ')[1]
530+
write(' Fixing merge commit SHA')
531531

532532
if codecov.slug:
533533
query['slug'] = codecov.slug

0 commit comments

Comments
 (0)
0