use of org.eclipse.jgit.lib.PersonIdent in project gerrit by GerritCodeReview.
the class AccountsUpdate method createInitialEmptyCommit.
private static ObjectId createInitialEmptyCommit(ObjectInserter oi, PersonIdent committerIdent, PersonIdent authorIdent, Timestamp registrationDate) throws IOException {
CommitBuilder cb = new CommitBuilder();
cb.setTreeId(emptyTree(oi));
cb.setCommitter(new PersonIdent(committerIdent, registrationDate));
cb.setAuthor(new PersonIdent(authorIdent, registrationDate));
cb.setMessage("Create Account");
ObjectId id = oi.insert(cb);
oi.flush();
return id;
}
use of org.eclipse.jgit.lib.PersonIdent in project fabric8 by jboss-fuse.
the class FabricGitFacade method write.
@Override
public CommitInfo write(final String branch, final String path, final String commitMessage, final String authorName, final String authorEmail, final String contents) {
assertValid();
final PersonIdent personIdent = new PersonIdent(authorName, authorEmail);
return gitWriteOperation(personIdent, new GitOperation<CommitInfo>() {
public CommitInfo call(Git git, GitContext context) throws Exception {
checkoutBranch(git, branch);
File rootDir = getRootGitDirectory(git);
byte[] data = contents.getBytes();
CommitInfo answer = doWrite(git, rootDir, branch, path, data, personIdent, commitMessage);
context.commitMessage(commitMessage);
return answer;
}
});
}
use of org.eclipse.jgit.lib.PersonIdent in project fabric8 by jboss-fuse.
the class FabricGitFacade method revertTo.
@Override
public void revertTo(final String branch, final String objectId, final String blobPath, final String commitMessage, final String authorName, final String authorEmail) {
assertValid();
final PersonIdent personIdent = new PersonIdent(authorName, authorEmail);
gitWriteOperation(personIdent, new GitOperation<Void>() {
public Void call(Git git, GitContext context) throws Exception {
checkoutBranch(git, branch);
File rootDir = getRootGitDirectory(git);
Void answer = doRevert(git, rootDir, branch, objectId, blobPath, commitMessage, personIdent);
context.commitMessage(commitMessage);
return answer;
}
});
}
use of org.eclipse.jgit.lib.PersonIdent in project fabric8 by jboss-fuse.
the class FabricGitFacade method writeBase64.
@Override
public CommitInfo writeBase64(final String branch, final String path, final String commitMessage, final String authorName, final String authorEmail, final String contents) {
assertValid();
final PersonIdent personIdent = new PersonIdent(authorName, authorEmail);
return gitWriteOperation(personIdent, new GitOperation<CommitInfo>() {
public CommitInfo call(Git git, GitContext context) throws Exception {
checkoutBranch(git, branch);
File rootDir = getRootGitDirectory(git);
byte[] data = Base64.decode(contents);
CommitInfo answer = doWrite(git, rootDir, branch, path, data, personIdent, commitMessage);
context.commitMessage(commitMessage);
return answer;
}
});
}
use of org.eclipse.jgit.lib.PersonIdent in project archi-modelrepository-plugin by archi-contribs.
the class CommitDialog method storeUserDetails.
/*
* Store user name and email
* If these are the same as those in .gitconfig don't store
*/
private void storeUserDetails(String name, String email) throws IOException, ConfigInvalidException {
PersonIdent global = GraficoUtils.getGitConfigUserDetails();
String globalName = global.getName();
String globalEmail = global.getEmailAddress();
if (!globalName.equals(name) || !globalEmail.equals(email)) {
fRepository.saveUserDetails(name, email);
}
}
Aggregations