Avoid cloning the full repositories, use remote-ls instead
When building packages we currently depend on:
- the current commit with the packaging sources
- the
pristine-lfs
branch for the orig tarball - the
pristine-lfs-source
branch to store the built source package - the tags on the current commit, if any, to check whether we should
pick the already built sources from
pristine-lfs-source
- the tag corresponding to the current changelog version, to avoid building a different commit with an already-used version
To cover 2, 3, and 5 we used to do a full clone of the repository, which
can be quite large in case of linux
or firefox-esr
.
But we do not actually need the full history, so let's pull only the
current commit and fetch pristine-lfs
and pristine-lfs-source
explicitly.
To check whether the current tag already exists, query the remote with
git ls-remote
rather than retrieving anything locally.