-
Name Previous Value Current Value Priority
Normal
Minor
-
OneDev
changed state to 'Closed' 2 years ago
Previous Value Current Value Open
Closed
-
OneDev
changed state to 'Released' 2 years ago
Previous Value Current Value Closed
Released
-
State changed as build #4194 is successful
| Type |
Bug
|
| Priority |
Minor
|
| Assignee | |
| Affected Versions |
9.1.5
|
| Labels |
No labels
|
Issue Votes (0)
I am having a job that has two steps:
git fetch --tagsin order to be able to calculate a build version based on git tagsThis works if I run the job manually but it fails if I trigger it via tag creation.
I am using the macOS Tool "Fork" which uses annotated tags in order to store a message along with the tag. On console that would be
However doing so creates a tag object in git in order to store the tag message on the tag itself. That means in
.git/refs/tags/1.0.0the hash of the tag object is stored and not the hashe7b9e6a3517f9dbb68073d613768fef02742eb25of the commit being tagged. So for example09df3af02d5fe74b46e776b2bc4f9ffc863dfb4eis stored andgit show 09df3af02d5fe74b46e776b2bc4f9ffc863dfb4ewould output the tag information, including the tag message, as well as the linked commit information.I have looked into the code of OneDev and the
Checkoutstep roughly doesSo it always uses the commit being tagged. Now technically everything seems ok.
git log --onelineshows correct history andgit tagshows tag1.0.0. However if I now dogit fetch --tagsI get a git error saying that the fetched tag 1.0.0 would clobber with an existing tag. The reason is that the fetched tag has the hash of the tag object instead of the hash of the tagged commit.So OneDev should call
update-refwith the hash of the tag object instead of the hash of the commit being tagged if the tag is an annotated tag.I think as a workaround I could use
git fetch --tags --forcewhich will override local tags, but OneDev should setup the checked out repository correctly.