diff --git a/list_changed_files/list_changed_files.sh b/list_changed_files/list_changed_files.sh index 80d4f712..642f7df7 100755 --- a/list_changed_files/list_changed_files.sh +++ b/list_changed_files/list_changed_files.sh @@ -10,6 +10,8 @@ # Don't be strict. Script has own error control handle set +e +difffilter=${1:-"ACDMRTUXB"} + # Verify everything is set required="gitcmd gitdir initialcommit finalcommit" for var in $required; do @@ -46,5 +48,5 @@ if [[ ${PIPESTATUS[0]} -ne 0 ]]; then fi # get all the files changed between both commits (no matter the diffs are empty) -git log --name-only --pretty=oneline --full-index ${initialcommit}..${finalcommit} | \ +git log --diff-filter=${difffilter} --find-renames=100% --name-only --pretty=oneline --full-index ${initialcommit}..${finalcommit} | \ grep -vE '^[0-9a-f]{40} ' | sort | uniq diff --git a/mustache_lint/mustache_lint.sh b/mustache_lint/mustache_lint.sh index fdabfd40..d2d02d05 100755 --- a/mustache_lint/mustache_lint.sh +++ b/mustache_lint/mustache_lint.sh @@ -46,7 +46,9 @@ echo "Validating using $validator" export initialcommit=${GIT_PREVIOUS_COMMIT} export finalcommit=${GIT_COMMIT} -if mfiles=$(${mydir}/../list_changed_files/list_changed_files.sh) +# Fetch all files, excluding files which are renames. +# There is no need to check renames. +if mfiles=$(${mydir}/../list_changed_files/list_changed_files.sh r) then echo "Running mustache lint from $initialcommit to $finalcommit:" else