8000 improve merge commit detection · codecov/codecov-bash@beaae43 · GitHub
[go: up one dir, main page]

Skip to content
This repository was archived by the owner on Jan 10, 2023. It is now read-only.

Commit beaae43

Browse files
committed
improve merge commit detection
See codecov/codecov-python#118
1 parent 8163b8e commit beaae43

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

codecov

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -760,11 +760,11 @@ fi
760760
if [ "$commit_o" = "" ];
761761
then
762762
# merge commit -> actual commit
763-
mc=$(git log -1 --pretty=%B 2>/dev/null | tr -d '[[:space:]]' || true)
764-
if [[ "$mc" =~ ^Merge[[:space:]][a-z0-9]{40}[[:space:]]into[[:space:]][a-z0-9]{40}$ ]];
763+
mc=$(git show --no-patch --format="%P" 2>/dev/null | tr -d '[[:space:]]' || echo "")
764+
if [[ "$mc" =~ ^[a-z0-9]{40}[[:space:]][a-z0-9]{40}$ ]];
765765
then
766766
# Merge xxx into yyy
767-
say " Fixing merge commit sha"
767+
say " Fixing merge commit SHA"
768768
commit=$(echo "$mc" | cut -d' ' -f2)
769769
elif [ "$GIT_COMMIT" != "" ];
770770
then

0 commit comments

Comments
 (0)
0