Skip to content

Commit 60582d6

Browse files
committed
[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.
1 parent feb1a8c commit 60582d6

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/lint/git-subtree-check.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
55

66
export LC_ALL=C
7-
DIR="$1"
7+
# Strip trailing / from directory path (in case it was added by autocomplete)
8+
DIR="${1%/}"
89
COMMIT="$2"
910
if [ -z "$COMMIT" ]; then
1011
COMMIT=HEAD

0 commit comments

Comments
 (0)