A colleague of mine attempted to delete the contents of a subdirectory from a Git repository. She pushed the local commit to the remote master (on a self-hosted GitLab repository). Now whenever we clone the remote repository, the subdirectory still gets cloned, but is empty. How is this even possible? I thought that Git works only with files, not with directories, and that it's not possible for a repository to contain an empty directory.
Some sanity checks I've run:
- The subdirectory in question really is empty (i.e., it doesn't contain any hidden files).
- The subdirectory really is a directory (i.e., it isn't as symbolic link).
- The subdirectory isn't for a submodule. (The Git project has no submodules.)
What other circumstances could possibly lead to Git maintaining an empty directory? Is there something else I am overlooking, or is this a new feature (or possibly a bug) in Git?