I'm trying to test if a git repository has the showuntrackedfiles
option set to no
.
My first aproch was:
if test (git config --get status.showuntrackedfiles) = no
echo "hi"
else
echo "bye"
end
but this breaks if showuntrackedfiles
is not set.
test: Missing argument at index 2
(Type 'help test' for related documentation)
bye
The only workaround I've found is:
if test (git config --get status.showuntrackedfiles; or echo "") = no
echo "hi"
else
echo "bye"
end
but it seems hacky. Is there a better way of approaching this?