mirror of
https://github.com/scm-manager/scm-manager.git
synced 2026-02-04 05:39:11 +01:00
fix git tag command unit test
This commit is contained in:
@@ -65,14 +65,12 @@ import static sonia.scm.ContextEntry.ContextBuilder.entity;
|
||||
import static sonia.scm.NotFoundException.notFound;
|
||||
|
||||
public class GitTagCommand extends AbstractGitCommand implements TagCommand {
|
||||
private final GPG gpg;
|
||||
private final HookContextFactory hookContextFactory;
|
||||
private final ScmEventBus eventBus;
|
||||
|
||||
@Inject
|
||||
GitTagCommand(GitContext context, GPG gpg, HookContextFactory hookContextFactory, ScmEventBus eventBus) {
|
||||
GitTagCommand(GitContext context, HookContextFactory hookContextFactory, ScmEventBus eventBus) {
|
||||
super(context);
|
||||
this.gpg = gpg;
|
||||
this.hookContextFactory = hookContextFactory;
|
||||
this.eventBus = eventBus;
|
||||
}
|
||||
@@ -114,20 +112,12 @@ public class GitTagCommand extends AbstractGitCommand implements TagCommand {
|
||||
User user = SecurityUtils.getSubject().getPrincipals().oneByType(User.class);
|
||||
PersonIdent taggerIdent = new PersonIdent(user.getDisplayName(), user.getMail());
|
||||
|
||||
// Ref ref =
|
||||
git.tag()
|
||||
.setObjectId(revObject)
|
||||
.setTagger(taggerIdent)
|
||||
.setName(name)
|
||||
.call();
|
||||
|
||||
// Uncomment lines once jgit added support for signing tags
|
||||
// try (RevWalk walk = new RevWalk(git.getRepository())) {
|
||||
// revObject = walk.parseTag(ref.getObjectId());
|
||||
// final Optional<Signature> tagSignature = GitUtil.getTagSignature(revObject, gpg, walk);
|
||||
// tagSignature.ifPresent(tag::addSignature);
|
||||
// }
|
||||
|
||||
eventBus.post(new PostReceiveRepositoryHookEvent(hookEvent));
|
||||
|
||||
return tag;
|
||||
|
||||
Reference in New Issue
Block a user