Skip to content

Commit

Permalink
First attempt at fixing tag
Browse files Browse the repository at this point in the history
  • Loading branch information
edmundmiller committed Dec 13, 2024
1 parent bc52d2b commit 3fb101c
Showing 1 changed file with 9 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -939,7 +939,15 @@ class AssetManager {
def current = getCurrentRevision()
if( current != defaultBranch ) {
if( !revision ) {
throw new AbortOperationException("Project `$project` is currently stuck on revision: $current -- you need to explicitly specify a revision with the option `-r` in order to use it")
Ref head = git.getRepository().findRef(Constants.HEAD);

// try to resolve the the current object id to a tag name
Map<ObjectId, String> names = git.nameRev().addPrefix( "refs/tags/" ).add(head.objectId).call()
def tag = names.get( head.objectId ) ?: head.objectId.name()
println tag
if( current != tag ) {
throw new AbortOperationException("Project `$project` is currently stuck on revision: $current -- you need to explicitly specify a revision with the option `-r` in order to use it")
}
}
}
if( !revision || revision == current ) {
Expand Down

0 comments on commit 3fb101c

Please sign in to comment.