style.fish: Just ask for uncommitted changes

I keep some files around that I don't *want* to commit or ignore, but
it's fine to restyle them.

It's also fine to restyle everything if you are about to commit
something because then it'll be committed in the correct style.
This commit is contained in:
Fabian Boehm 2022-06-16 18:45:46 +02:00
parent 7d3127ac2b
commit 8dbd23372f

View file

@ -23,9 +23,11 @@ if test $all = yes
set -l files (git status --porcelain --short --untracked-files=all | sed -e 's/^ *[^ ]* *//')
if set -q files[1]
echo
echo You have uncommitted changes. Cowardly refusing to restyle the entire code base.
echo
exit 1
echo 'You have uncommitted changes. Are you sure you want to restyle?'
read -P 'y/N? ' -n1 -l ans
if not string match -qi "y" -- $ans
exit 1
end
end
set c_files src/*.h src/*.cpp src/*.c
set fish_files share/**.fish