mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-06-19 08:58:28 +02: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 tmp cd754680a6 &&
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
1 changed files with 4 additions and 0 deletions
|
|
@ -113,6 +113,10 @@ if [ $SHOW_FILENAMES = 1 ]; then
|
|||
exit 0
|
||||
fi
|
||||
|
||||
if [ "${#FILES[@]}" = 0 ]; then
|
||||
die "Error: no files to check"
|
||||
fi
|
||||
|
||||
FLAGS_TEST=( --Werror -n --ferror-limit=1 )
|
||||
|
||||
if [ $TEST_ONLY = 1 ]; then
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue