jbauer opened 7 months ago
|
|||||||
Robin Shen changed fields 7 months ago
|
|||||||
OneDev changed state to 'Closed' 7 months ago
|
|||||||
State changed as code fixing the issue is committed (655b27ef7c55adf4909847323db2868e1f3ccc4d) |
|||||||
Referenced from commit 7 months ago
|
|||||||
OneDev changed state to 'Released' 7 months ago
|
|||||||
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 --tags
in 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.0
the hash of the tag object is stored and not the hashe7b9e6a3517f9dbb68073d613768fef02742eb25
of the commit being tagged. So for example09df3af02d5fe74b46e776b2bc4f9ffc863dfb4e
is stored andgit show 09df3af02d5fe74b46e776b2bc4f9ffc863dfb4e
would 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
Checkout
step roughly doesSo it always uses the commit being tagged. Now technically everything seems ok.
git log --oneline
shows correct history andgit tag
shows tag1.0.0
. However if I now dogit fetch --tags
I 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-ref
with 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 --force
which will override local tags, but OneDev should setup the checked out repository correctly.