Package org.eclipse.jgit.lib

Examples of org.eclipse.jgit.lib.PersonIdent


    rp.setRefLogIdent(toPersonIdent(req, user));
    return rp;
  }

  private static PersonIdent toPersonIdent(HttpServletRequest req, String user) {
    return new PersonIdent(user, user + "@" + req.getRemoteHost());
  }
View Full Code Here


    // before the LF in case of LF termination resp. the penultimate
    // character if there is no trailing LF.
    final int tzBegin = lastIndexOfTrim(raw, ' ',
        nextLF(raw, emailE - 1) - 2) + 1;
    if (tzBegin <= emailE) // No time/zone, still valid
      return new PersonIdent(name, email, 0, 0);

    final int whenBegin = Math.max(emailE,
        lastIndexOfTrim(raw, ' ', tzBegin - 1) + 1);
    if (whenBegin >= tzBegin - 1) // No time/zone, still valid
      return new PersonIdent(name, email, 0, 0);

    final long when = parseLongBase10(raw, whenBegin, null);
    final int tz = parseTimeZoneOffset(raw, tzBegin);
    return new PersonIdent(name, email, when * 1000L, tz);
  }
View Full Code Here

      tz = parseTimeZoneOffset(raw, ptrout.value);
    } else {
      when = 0;
      tz = 0;
    }
    return new PersonIdent(name, email, when * 1000L, tz);
  }
View Full Code Here

    }
    return parseAuthor(raw);
  }

  private RebaseResult stop(RevCommit commitToPick) throws IOException {
    PersonIdent author = commitToPick.getAuthorIdent();
    String authorScript = toAuthorScript(author);
    createFile(rebaseDir, AUTHOR_SCRIPT, authorScript);
    createFile(rebaseDir, MESSAGE, commitToPick.getFullMessage());
    ByteArrayOutputStream bos = new ByteArrayOutputStream();
    DiffFormatter df = new DiffFormatter(bos);
View Full Code Here

    int minutes = Integer.parseInt(tzOffsetString.substring(3, 5));
    // this is in format (+/-)HHMM (hours and minutes)
    // we need to convert into minutes
    int tz = (hours * 60 + minutes) * multiplier;
    if (name != null && email != null)
      return new PersonIdent(name, email, when, tz);
    return null;
  }
View Full Code Here

   * @throws NoMessageException
   *             if the commit message has not been specified
   */
  private void processOptions(RepositoryState state) throws NoMessageException {
    if (committer == null)
      committer = new PersonIdent(repo);
    if (author == null)
      author = committer;

    // when doing a merge commit parse MERGE_HEAD and MERGE_MSG files
    if (state == RepositoryState.MERGING_RESOLVED) {
View Full Code Here

   *            the email of the committer used for the {@code commit}
   * @return {@code this}
   */
  public CommitCommand setCommitter(String name, String email) {
    checkCallable();
    return setCommitter(new PersonIdent(name, email));
  }
View Full Code Here

   *            the email of the author used for the {@code commit}
   * @return {@code this}
   */
  public CommitCommand setAuthor(String name, String email) {
    checkCallable();
    return setAuthor(new PersonIdent(name, email));
  }
View Full Code Here

   *             if the tag is signed (not supported yet)
   */
  private void processOptions(RepositoryState state)
      throws InvalidTagNameException {
    if (tagger == null)
      tagger = new PersonIdent(repo);
    if (name == null || !Repository.isValidRefName(Constants.R_TAGS + name))
      throw new InvalidTagNameException(MessageFormat.format(JGitText
          .get().tagNameInvalid, name == null ? "<null>" : name));
    if (signed)
      throw new UnsupportedOperationException(
View Full Code Here

    ceilTestDirectories(getCeilings());
    SystemReader.setInstance(mockSystemReader);

    final long now = mockSystemReader.getCurrentTime();
    final int tz = mockSystemReader.getTimezone(now);
    author = new PersonIdent("J. Author", "jauthor@example.com");
    author = new PersonIdent(author, now, tz);

    committer = new PersonIdent("J. Committer", "jcommitter@example.com");
    committer = new PersonIdent(committer, now, tz);

    final WindowCacheConfig c = new WindowCacheConfig();
    c.setPackedGitLimit(128 * WindowCacheConfig.KB);
    c.setPackedGitWindowSize(8 * WindowCacheConfig.KB);
    c.setPackedGitMMAP(useMMAP);
 
View Full Code Here

TOP

Related Classes of org.eclipse.jgit.lib.PersonIdent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.