mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-07-23 17:44:18 +02:00
[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.
This commit is contained in:
@@ -4,7 +4,8 @@
|
|||||||
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
||||||
|
|
||||||
export LC_ALL=C
|
export LC_ALL=C
|
||||||
DIR="$1"
|
# Strip trailing / from directory path (in case it was added by autocomplete)
|
||||||
|
DIR="${1%/}"
|
||||||
COMMIT="$2"
|
COMMIT="$2"
|
||||||
if [ -z "$COMMIT" ]; then
|
if [ -z "$COMMIT" ]; then
|
||||||
COMMIT=HEAD
|
COMMIT=HEAD
|
||||||
|
Reference in New Issue
Block a user