mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager
synced 2024-10-14 12:05:03 +00:00
contrib: handle no files in "nm-code-format.sh"
Calling `clang-format` with no files means to read stdin, it thus hangs: $ ./contrib/scripts/nm-code-format.sh .git Also, the following does not work: $ ./contrib/scripts/nm-code-format.sh src/platform/ hangs. Seems there is a bug in `git ls-files` to not list all files: podman run -ti alpine:latest \ sh -c ' apk add git && git clone https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git && cd NetworkManager && git checkout -B tmpcd754680a6
&& echo ">>>>>>BAD1: $PWD" && git ls-files -- src/platform/ ":(exclude)shared/n-acd" echo ">>>>>>GOOD1: $PWD" && git ls-files -- src/platform/ ":(exclude)shared/c-list" echo ">>>>>>GOOD2: $PWD" && git ls-files -- src/platform ":(exclude)shared/n-acd" echo ">>>>>>GOOD3: $PWD" && git ls-files -- src/vpn/ ":(exclude)shared/n-acd" ' Fixes:9bef4ece92
('contrib: improve nm-code-format.sh script')
This commit is contained in:
parent
cd754680a6
commit
8e735a51b8
|
@ -113,6 +113,10 @@ if [ $SHOW_FILENAMES = 1 ]; then
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ "${#FILES[@]}" = 0 ]; then
|
||||||
|
die "Error: no files to check"
|
||||||
|
fi
|
||||||
|
|
||||||
FLAGS_TEST=( --Werror -n --ferror-limit=1 )
|
FLAGS_TEST=( --Werror -n --ferror-limit=1 )
|
||||||
|
|
||||||
if [ $TEST_ONLY = 1 ]; then
|
if [ $TEST_ONLY = 1 ]; then
|
||||||
|
|
Loading…
Reference in a new issue