"H. Peter Anvin" [off-list ref] writes:
If this is meant to dequote shell-quoted paths, it really should be modal.
You are right, but this is not meant to dequote arbitrary shell
quoted paths. It specifically is for unwrapping what sq_quote()
produced, and refuses to proceed if you feed some shell-valid
but not sq_quote() produced string. The reason is because it is
part of the git-shell "login shell" -- the input validation is
enforced there.
And the reason it lives next to quote.c::sq_quote() is that you
would hopefully notice sq_dequote() needs matching changes when
you ever update sq_quote.