Skip to content

Commit

Permalink
fix increment_coverage (DeepLink-org#485)
Browse files Browse the repository at this point in the history
  • Loading branch information
lwj-st authored Oct 16, 2023
1 parent 4bba148 commit 1079846
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions scripts/increment_coverage.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ echo "entering "$ROOT_DIR
require_coverage=$1

lcov -c -d . --include "*/${ROOT_DIR#/mnt/*/}/${include}/*" -o coverage/coverage.info
newcommit=`git rev-parse --short HEAD`
oldcommit=`git reflog | grep 'checkout: moving from main to' | awk '{print $1}'`
newcommit=`git rev-parse HEAD~1`
oldcommit=`git merge-base ${newcommit} main`
if [ -z $oldcommit ];then echo "is not Pull request" && exit 0;fi
git diff $oldcommit $newcommit --name-only | xargs -I {} realpath {} > coverage/gitdiff.txt 2>/dev/null || echo "error can be ignored"
for dir in `cat coverage/gitdiff.txt`;do
Expand Down

0 comments on commit 1079846

Please sign in to comment.