mirror of
https://github.com/apache/nuttx.git
synced 2026-05-21 21:34:07 +08:00
tools/checkpatch.sh: enhance added files judgement with +++ at the line beginning
In https://github.com/apache/incubator-nuttx-apps/pull/179, there is a removed graphics/littlevgl/lv_symbol_def.patch file whose content would be treated abnormally and results in errors. Signed-off-by: liuhaitao <liuhaitao@xiaomi.com>
This commit is contained in:
+2
-2
@@ -56,7 +56,7 @@ check_file() {
|
||||
|
||||
check_ranges() {
|
||||
while read; do
|
||||
if [[ $REPLY =~ \+\+\+\ (b/)?([^[:blank:]]+).* ]]; then
|
||||
if [[ $REPLY =~ ^(\+\+\+\ (b/)?([^[:blank:]]+).*)$ ]]; then
|
||||
if [ "$ranges" != "" ]; then
|
||||
if [ $range != 0 ]; then
|
||||
check_file $ranges $path 2>&1
|
||||
@@ -64,7 +64,7 @@ check_ranges() {
|
||||
check_file $path 2>&1
|
||||
fi
|
||||
fi
|
||||
path=${BASH_REMATCH[2]}
|
||||
path=${BASH_REMATCH[3]}
|
||||
ranges=""
|
||||
elif [[ $REPLY =~ @@\ -[0-9]+(,[0-9]+)?\ \+([0-9]+,[0-9]+)?\ @@.* ]]; then
|
||||
ranges+="-r ${BASH_REMATCH[2]} "
|
||||
|
||||
Reference in New Issue
Block a user