From 60582d6060542c1e3a23141ea825e36818fbbd54 Mon Sep 17 00:00:00 2001 From: John Newbery Date: Thu, 31 Oct 2019 11:53:46 -0400 Subject: [linter] Strip trailing / in path for git-subtree-check 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. --- test/lint/git-subtree-check.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'test/lint') diff --git a/test/lint/git-subtree-check.sh b/test/lint/git-subtree-check.sh index 85e8b841b6..7b5707a17a 100755 --- a/test/lint/git-subtree-check.sh +++ b/test/lint/git-subtree-check.sh @@ -4,7 +4,8 @@ # file COPYING or http://www.opensource.org/licenses/mit-license.php. export LC_ALL=C -DIR="$1" +# Strip trailing / from directory path (in case it was added by autocomplete) +DIR="${1%/}" COMMIT="$2" if [ -z "$COMMIT" ]; then COMMIT=HEAD -- cgit v1.2.3