git-subtree-check fails if the directory is given with a trailing slash, eg:
> test/lint/git-subtree-check.sh src/univalue/
ERROR: src/univalue/ is not a subtree
Shell autocompletes will add the trailing slash when autofilling the path name, which will therefore cause the script to fail.
Just ignore any trailing slash.