Although the zzz
entry creates a directory, it is not meant to represent an empty directory. The key to seeing this is to compare its type
and mode
with the other directories. The mode for zzz
is 160000
and its type is commit
; the tree objects yyy
, vvv
, and uuu
, which end up storing non-empty directories, have mode 040000
and type tree
.
What this means is that the zzz
entry is a so-called "gitlink".
The associated hash ID (clearly you made the ones above up; they have far too many zeros to be coincidence) is the hash of the submodule that Git should check out into that directory. Git will make the directory itself as part of checking out this superproject. Later, though, Git will read the .gitmodules
configuration file to find the appropriate subproject URL: it will clone that repository into the zzz
directory when you do git submodule init
.
You can get Git to do this automatically during the superproject's git clone
if you clone with git clone --recursive
. See How to `git clone` including submodules? for details.
See also Where does Git store the SHA1 of the commit for a submodule?
Note that if there is no .gitmodules
entry for the path, Git does not know what to clone here. These "fake" entries may therefore be (ab)used to create empty directories. It sort-of works. There are no promises that it will keep working in later versions of Git, though, and in any case Git just kind of loses track of files within here, as it thinks they belong to another repository. Most of this paragraph is a link to the answer that describes this in detail.