'How can I tell whether a Git checkout is using `sparse-checkout`?

If I am looking at a Git checkout (a directory with a .git directory inside it), is there any way I can tell whether this is a "sparse checkout" (https://git-scm.com/docs/git-sparse-checkout) or not?

Ideally, the solution would be able to just inspect files in the directory instead of calling actual git commands.



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source