Hello,
I would like to request the support of using tag names when doing a shallow clone.
If I understood correctly, when shallow clone is used with a revision it will run:
elif depth and revision:
self.path.mkdir(parents=True)
self._run(("init",), capture_output=True)
self._run(("remote", "add", "origin", str(url)))
self._run(("fetch", "--depth", str(depth), "origin", revision), capture_output=True)
if revision:
self._run(("checkout", revision), capture_output=True)
But if revision is a tag, the checkout will fail:
error: pathspec '<tag>' did not match any file(s) known to git
I did some digging, and knowing that the revision is a tag, the git fetch could be executed as:
git fetch --depth 1 origin tag <tag>
Which makes the checkout work properly.
Hello,
I would like to request the support of using tag names when doing a shallow clone.
If I understood correctly, when shallow clone is used with a revision it will run:
But if revision is a tag, the checkout will fail:
error: pathspec '<tag>' did not match any file(s) known to gitI did some digging, and knowing that the revision is a tag, the git fetch could be executed as:
git fetch --depth 1 origin tag <tag>Which makes the checkout work properly.