Skip to content

Commit d636cd7

Browse files
authored
fix increment coverage (DeepLink-org#829)
1 parent bb1b3b8 commit d636cd7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Diff for: scripts/increment_coverage.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ commit_hash=$(git rev-parse HEAD)
1919
parent_count=$(git log --pretty=%P -n 1 $commit_hash | wc -w)
2020
if [ $parent_count -eq 1 ]; then #no new commits in main branch
2121
newcommit=$commit_hash
22-
oldcommit=$(git merge-base ${newcommit} main)
22+
oldcommit=$(git merge-base ${newcommit} mainrepo/main)
2323
if [ -z $oldcommit ]; then echo "Cannot find merge-base commit" && exit 1; fi
2424
echo "Found merge-base commit: $oldcommit"
2525
git diff $oldcommit $newcommit --name-only > $ROOT_DIR/coverage/gitdiff.txt 2>/dev/null || echo "error can be ignored"
@@ -39,7 +39,7 @@ else #has new commits in main branch
3939
fi
4040

4141
cd $ROOT_DIR
42-
cat coverage/gitdiff.txt |egrep '\.(cpp|hpp|h)$'|grep "$include/" >coverage/gitdiff_screen.txt || true
42+
cat coverage/gitdiff.txt |egrep '\.(cpp|hpp)$'|grep "$include/" >coverage/gitdiff_screen.txt || true
4343
if [ ! -s coverage/gitdiff_screen.txt ]; then echo "No C/C++ in incremental code" && exit 0;fi
4444
rm -rf coverage/gitdiff.txt
4545
while IFS= read -r line; do

0 commit comments

Comments
 (0)