Skip to content

Commit 811c381

Browse files
committed
Merge #17329: linter: Strip trailing / in path for git-subtree-check
60582d6 [linter] Strip trailing / in path for git-subtree-check (John Newbery) Pull request description: 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. ACKs for top commit: laanwj: ACK 60582d6 dongcarl: ACK 60582d6 fanquake: ACK 60582d6 - tested before and after. Tree-SHA512: 5a91979b60e1d4b1310fd02a0ccc5465dbff57d9c94bba81e4758442a627cfa32217ab8f973990a17b5d961ecae61fb56b56ccf10f87e61dd03e88a1e0b8f99d
2 parents 100fa0a + 60582d6 commit 811c381

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)