aajisaka commented on a change in pull request #96: YETUS-949. remove empty 
filenames in find_changed_files
URL: https://github.com/apache/yetus/pull/96#discussion_r384361436
 
 

 ##########
 File path: precommit/src/main/shell/core.d/change-analysis.sh
 ##########
 @@ -68,7 +68,9 @@ function find_changed_files
       # Additionally, remove any a/ b/ patterns at the front of the patch 
filenames.
       # shellcheck disable=SC2016
       while read -r line; do
-        CHANGED_FILES=("${CHANGED_FILES[@]}" "${line}")
+        if [[ -n "${line}" ]]; then
+          CHANGED_FILES=("${CHANGED_FILES[@]}" "${line}")
+        fi
       done < <(
         "${AWK}" 'function p(s){sub("^[ab]/","",s); if(s!~"^/dev/null"){print 
s}}
 
 Review comment:
   If "---" or "+++" is passed, the awk function prints an empty string. I 
think this issue should be fixed in the function.
   
   ```suggestion
           "${AWK}" 'function p(s){sub("^[ab]/","",s); 
if(s!~"^/dev/null"&&s!~"^[[:blank:]]*$"){print s}}
   ```

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to