Commit f059ba93 authored by Matt McCormick's avatar Matt McCormick Committed by David Cole
Browse files

ENH: pre-commit: Prevent add .txx files.

A transition occurred in the toolkit to move all .txx files to .hxx files.
This prevents accidental additions of or renames to .txx files.

Change-Id: Id4ace9cfca2c56506d93396366d146173e015003
parent 69b19172
......@@ -299,6 +299,22 @@ done
test -z "$bad" || die "$bad"
# Do not allow adding of files with .txx extension.
diffs_added=$(git diff-index --diff-filter=A --cached $against -- |
sed -n '/^:[^:]/ {s/^://;p;}')
diffs_normal_added=$(echo "$diffs" | grep -v '^...... 160000')
test -n "$diffs_normal" && echo "$diffs_normal" |
while read src_mode dst_mode src_obj dst_obj status file; do
if echo "$file" | grep -q -E '\.txx$'; then
echo "Attempted to add file $file."
echo "Files with the .txx extension are not allowed -- use .hxx instead."
test -z "$bad" || die "$bad"
# Merge checks.
if test -n "$merge_head"; then
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment