diff --git a/src/Verlite.Core/GitRepoInspector.cs b/src/Verlite.Core/GitRepoInspector.cs index 2b40645..26d2e3a 100644 --- a/src/Verlite.Core/GitRepoInspector.cs +++ b/src/Verlite.Core/GitRepoInspector.cs @@ -493,6 +493,11 @@ public async Task FetchTag(Tag tag, string remote) { if (EnableLightweightTags) { + // make sure we actually have the commit object downloaded, else we can't tag it + // this may happen when the clone is exactly 1 commit too shallow, and this method, + // if using auto-fetch, we de-shallow appropriately + _ = await GetCommitObject(tag.PointsTo); + await Git("tag", "--no-sign", tag.Name, tag.PointsTo.Id); return; }