travis-ci: check that all build artifacts are .gitignore-d
[gitweb.git] / ci / lib-travisci.sh
index 1543b7959f04ea151e40d453ddc8048a1cf44cff..07f27c72700702e745eb0a9d1f9b9aa8ec549f4f 100755 (executable)
@@ -67,6 +67,16 @@ skip_good_tree () {
        exit 0
 }
 
+check_unignored_build_artifacts ()
+{
+       ! git ls-files --other --exclude-standard --error-unmatch \
+               -- ':/*' 2>/dev/null ||
+       {
+               echo "$(tput setaf 1)error: found unignored build artifacts$(tput sgr0)"
+               false
+       }
+}
+
 # Set 'exit on error' for all CI scripts to let the caller know that
 # something went wrong.
 # Set tracing executed commands, primarily setting environment variables