Skip to content

Commit

Permalink
Merge pull request #106 from AshleighAdams/lightweight-tag-too-shallo…
Browse files Browse the repository at this point in the history
…w-fix

Fix lightweight tags when the repo is exactly 1 commit too shallow
  • Loading branch information
AshleighAdams authored Oct 11, 2022
2 parents 9d39573 + 0b1abd0 commit ac3cebe
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/Verlite.Core/GitRepoInspector.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit ac3cebe

Please sign in to comment.