"Repository has no HEAD, can't create tag");
commitId = currHead.get().getObjectId();
}
RevPerson tagger = resolveTagger();
message = message == null ? "" : message;
RevTag tag = new RevTagImpl(ObjectId.NULL, name, commitId, message, tagger);
ObjectId id = command(HashObject.class).setObject(tag).call();
tag = new RevTagImpl(id, name, commitId, message, tagger);
objectDatabase().put(tag);
Optional<Ref> branchRef = command(UpdateRef.class).setName(tagRefPath)
.setNewValue(tag.getId()).call();
checkState(branchRef.isPresent());
return tag;
}