diff --git a/.gitattributes b/.gitattributes
index 7d1d16416e9710cd064deb28076df20ed10568bf..a13116aaf641eb75efad833a5a639dd7afb4ad3f 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -12,15 +12,16 @@ README		conflict-marker-size=32
 README.*	conflict-marker-size=32
 
 # Certain data files that contain special whitespace, and other special cases
-**/data/*.data					-whitespace
+*.data						-whitespace
 contrib/tsearch2/sql/tsearch2.sql		whitespace=space-before-tab,blank-at-eof,-blank-at-eol
 doc/bug.template				whitespace=space-before-tab,-blank-at-eof,blank-at-eol
 src/backend/catalog/sql_features.txt		whitespace=space-before-tab,blank-at-eof,-blank-at-eol
 src/backend/tsearch/hunspell_sample.affix	whitespace=-blank-at-eof
 
 # Test output files that contain extra whitespace
-**/expected/*.out			-whitespace
-**/output/*.source			-whitespace
+*.out					-whitespace
+contrib/*/output/*.source		-whitespace
+src/test/regress/output/*.source	-whitespace
 src/interfaces/ecpg/test/expected/*	-whitespace
 src/interfaces/libpq/test/expected.out	whitespace=-blank-at-eof