aboutsummaryrefslogtreecommitdiff
path: root/test/lint
diff options
context:
space:
mode:
authorJohn Newbery <john@johnnewbery.com>2019-10-31 11:53:46 -0400
committerJohn Newbery <john@johnnewbery.com>2019-10-31 11:53:46 -0400
commit60582d6060542c1e3a23141ea825e36818fbbd54 (patch)
treec87ab4c9eec5d8d9ba853b420e265df20268123d /test/lint
parentfeb1a8c03aff0d37730d80eee7a05cc7e4729850 (diff)
downloadbitcoin-60582d6060542c1e3a23141ea825e36818fbbd54.tar.xz
[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.
Diffstat (limited to 'test/lint')
-rwxr-xr-xtest/lint/git-subtree-check.sh3
1 files changed, 2 insertions, 1 deletions
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