git/pre-applypatch
Junio C Hamano ca2a4aa4a4 Meta/Make: update test skipping logic
Request to "Meta/Make --test=????" should override the default built-in
list of tests to skip on each test bochs.
2011-05-30 13:43:28 -07:00

33 lines
585 B
Bash
Executable File

#!/bin/sh
. git-sh-setup
# Avoid duplicated test numbers --- checking 'pu' is enough
# as we will usually add, but never remove them.
added=$(
git diff-index --cached --name-only --diff-filter=A HEAD -- t |
sed -ne 's|t/\(t[0-9][0-9][0-9][0-9]\)-.*\.sh$|\1|p'
)
if test -n "$added"
then
bad=
exists=$(
git ls-tree --name-only pu:t |
sed -ne 's|^\(t[0-9][0-9][0-9][0-9]\)-.*\.sh$|\1|p' |
tr "\012" " "
)
for a in $added
do
case " $exists " in
*" $a "*)
echo >&2 "Test number $a already taken"
bad=1
;;
esac
done
if test -n "$bad"
then
: exit 1
fi
fi