summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-09-08 21:35:54 -0700
committerJunio C Hamano <gitster@pobox.com>2016-09-08 21:35:54 -0700
commit86df11b1a46dd9c3e383b02d21f17d9329aff6e0 (patch)
tree6f883f5ba1bc926473f32540bfef29f1e484957e /t
parent8e7c580e34a95576966516d2a6d45fd2c4c00180 (diff)
parentc2cafd39bcf88d87fa2f8f0bea125b60ce22a095 (diff)
downloadgit-86df11b1a46dd9c3e383b02d21f17d9329aff6e0.tar.gz
Merge branch 'js/test-lint-pathname' into maint
The "t/" hierarchy is prone to get an unusual pathname; "make test" has been taught to make sure they do not contain paths that cannot be checked out on Windows (and the mechanism can be reusable to catch pathnames that are not portable to other platforms as need arises). * js/test-lint-pathname: t/Makefile: ensure that paths are valid on platforms we care
Diffstat (limited to 't')
-rw-r--r--t/Makefile11
1 files changed, 10 insertions, 1 deletions
diff --git a/t/Makefile b/t/Makefile
index 18e2b28b26..d613935f14 100644
--- a/t/Makefile
+++ b/t/Makefile
@@ -52,7 +52,8 @@ clean-except-prove-cache:
clean: clean-except-prove-cache
$(RM) .prove
-test-lint: test-lint-duplicates test-lint-executable test-lint-shell-syntax
+test-lint: test-lint-duplicates test-lint-executable test-lint-shell-syntax \
+ test-lint-filenames
test-lint-duplicates:
@dups=`echo $(T) | tr ' ' '\n' | sed 's/-.*//' | sort | uniq -d` && \
@@ -67,6 +68,14 @@ test-lint-executable:
test-lint-shell-syntax:
@'$(PERL_PATH_SQ)' check-non-portable-shell.pl $(T) $(THELPERS)
+test-lint-filenames:
+ @# We do *not* pass a glob to ls-files but use grep instead, to catch
+ @# non-ASCII characters (which are quoted within double-quotes)
+ @bad="$$(git -c core.quotepath=true ls-files 2>/dev/null | \
+ grep '["*:<>?\\|]')"; \
+ test -z "$$bad" || { \
+ echo >&2 "non-portable file name(s): $$bad"; exit 1; }
+
aggregate-results-and-cleanup: $(T)
$(MAKE) aggregate-results
$(MAKE) clean