diff options
-rwxr-xr-x | git-request-pull.sh | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/git-request-pull.sh b/git-request-pull.sh index 1058d2e..957a760 100755 --- a/git-request-pull.sh +++ b/git-request-pull.sh @@ -92,6 +92,20 @@ check_commit() errors=$((errors+1)) } fi + + # 4. The commit should not contain any file matching .gitignore + # patterns. + local files=$(git show --format= --name-only $commit | \ + git check-ignore --stdin --no-index) + if [ -n "$files" ] ; then + echo "Commit $summary contains files matching .gitignore patterns:" + local file + for file in $files ; do + echo "- $file" + done + + errors=$((errors+1)) + fi } check_commits() { |