uncrustify: use unified diff to generate GH annotation

`git diff` creates diffs where the file name starts with `a/` or `b/`
respectively. These are obviously not in path, so the Github annotations
point to nowhere when the path is used without accounting for this.

This fixes the GH annotation parsing to account for that.
This commit is contained in:
Martine Lenders 2021-01-14 12:12:50 +01:00
parent bd5b195433
commit 629d3cd39d
No known key found for this signature in database
GPG Key ID: CCD317364F63286F

View File

@ -57,7 +57,8 @@ exec_uncrustify () {
if echo "$line" | grep -q '^--- .\+$'; then
_annotate_diff "$DIFFFILE" "$DIFFLINE" "$DIFF"
DIFF="$line"
DIFFFILE=$(echo "$line" | sed 's/^--- \(.\+\)$/\1/g')
DIFFFILE=$(echo "$line" |
sed 's#^--- \([ab]/\)\?\(.\+\)$#\2#g')
DIFFLINE=""
# we are in a diff currently
elif [ -n "$DIFF" ]; then