use of org.eclipse.jgit.lib.TagBuilder in project gitiles by GerritCodeReview.
the class TimeCacheTest method tagMissingTime.
@Test
public void tagMissingTime() throws Exception {
RevCommit commit = repo.commit().create();
TagBuilder builder = new TagBuilder();
builder.setObjectId(commit);
builder.setTag("tag");
builder.setMessage("");
ObjectId id;
try (ObjectInserter ins = repo.getRepository().newObjectInserter()) {
id = ins.insert(builder);
ins.flush();
}
assertThat(getTime(commit)).isEqualTo(start + 1);
assertThat(getTime(id)).isEqualTo(start + 1);
}
use of org.eclipse.jgit.lib.TagBuilder in project gitiles by GerritCodeReview.
the class TimeCacheTest method firstTagMissingTime.
@Test
public void firstTagMissingTime() throws Exception {
RevCommit commit = repo.commit().create();
repo.tick(1);
RevTag tag = repo.tag("tag", commit);
repo.tick(1);
TagBuilder builder = new TagBuilder();
builder.setObjectId(tag);
builder.setTag("tagtag");
builder.setMessage("");
ObjectId tagTagId;
try (ObjectInserter ins = repo.getRepository().newObjectInserter()) {
tagTagId = ins.insert(builder);
ins.flush();
}
assertThat(getTime(commit)).isEqualTo(start + 1);
assertThat(getTime(tag)).isEqualTo(start + 2);
assertThat(getTime(tagTagId)).isEqualTo(start + 2);
}
use of org.eclipse.jgit.lib.TagBuilder in project egit by eclipse.
the class BranchAndResetActionTest method setup.
@Before
public void setup() throws Exception {
repositoryFile = createProjectAndCommitToRepository();
Repository repo = lookupRepository(repositoryFile);
TagBuilder tag = new TagBuilder();
tag.setTag("SomeTag");
tag.setTagger(RawParseUtils.parsePersonIdent(TestUtil.TESTAUTHOR));
tag.setMessage("I'm just a little tag");
tag.setObjectId(repo.resolve(repo.getFullBranch()), Constants.OBJ_COMMIT);
TagOperation top = new TagOperation(repo, tag, false);
top.execute(null);
touchAndSubmit(null);
RepositoriesViewLabelProvider provider = GitRepositoriesViewTestUtils.createLabelProvider();
LOCAL_BRANCHES = provider.getText(new LocalNode(new RepositoryNode(null, repo), repo));
TAGS = provider.getText(new TagsNode(new RepositoryNode(null, repo), repo));
}
use of org.eclipse.jgit.lib.TagBuilder in project egit by eclipse.
the class CompareActionsTest method setup.
@Before
public void setup() throws Exception {
repositoryFile = createProjectAndCommitToRepository();
Repository repo = lookupRepository(repositoryFile);
disablePerspectiveSwitchPrompt();
setEnabledModelProvider(ModelProvider.RESOURCE_MODEL_PROVIDER_ID);
TagBuilder tag = new TagBuilder();
tag.setTag("SomeTag");
tag.setTagger(RawParseUtils.parsePersonIdent(TestUtil.TESTAUTHOR));
tag.setMessage("I'm just a little tag");
tag.setObjectId(repo.resolve(repo.getFullBranch()), Constants.OBJ_COMMIT);
commitOfTag = tag.getObjectId();
TagOperation top = new TagOperation(repo, tag, false);
top.execute(null);
touchAndSubmit(null);
RepositoriesViewLabelProvider provider = GitRepositoriesViewTestUtils.createLabelProvider();
// LOCAL_BRANCHES = provider.getText(new LocalNode(new RepositoryNode(
// null, repo), repo));
TAGS = provider.getText(new TagsNode(new RepositoryNode(null, repo), repo));
}
use of org.eclipse.jgit.lib.TagBuilder in project egit by eclipse.
the class TagActionTest method setup.
@Before
public void setup() throws Exception {
repositoryFile = createProjectAndCommitToRepository();
Repository repo = lookupRepository(repositoryFile);
TagBuilder tag = new TagBuilder();
tag.setTag("SomeTag");
tag.setTagger(RawParseUtils.parsePersonIdent(TestUtil.TESTAUTHOR));
tag.setMessage("I'm just a little tag");
tag.setObjectId(repo.resolve(repo.getFullBranch()), Constants.OBJ_COMMIT);
TagOperation top = new TagOperation(repo, tag, false);
top.execute(null);
touchAndSubmit(null);
}
Aggregations