Shallow clones of local directories require file:// as explained at: git clone: warning: --depth is ignored in local clones; use file:// instead
But how
But how to use relative paths with that?
This is not supported; file:// expects only absolute paths. There are e.g. RFC1738 and RFC8089 which describe this kind of URIs.
A file URL takes the form:
file:/// where is the fully qualified domain name of the system on
which the is accessible, and is a hierarchical
directory path of the form //.../.
When you write file://mymodule, the mymodule can be interpreted as a hostname.