Package com.gitblit.models

Examples of com.gitblit.models.RefModel


        RevObject object = rw.parseAny(ref.getObjectId());
        String name = entry.getKey();
        if (fullName && !StringUtils.isEmpty(refs)) {
          name = refs + name;
        }
        list.add(new RefModel(name, ref, object));
      }
      rw.dispose();
      Collections.sort(list);
      Collections.reverse(list);
      if (maxCount > 0 && list.size() > maxCount) {
View Full Code Here


   *
   * @param repository
   * @return a refmodel for the branch or null
   */
  public static RefModel getBranch(Repository repository, String name) {
    RefModel branch = null;
    try {
      // search for the branch in local heads
      for (RefModel ref : JGitUtils.getLocalBranches(repository, false, -1)) {
        if (ref.reference.getName().endsWith(name)) {
          branch = ref;
View Full Code Here

      // flat notes list
      String notePath = commit.getName();
      String text = getStringContent(repository, notesTree, notePath);
      if (!StringUtils.isEmpty(text)) {
        List<RevCommit> history = getRevLog(repository, notesRef.getName(), notePath, 0, -1);
        RefModel noteRef = new RefModel(notesRef.displayName, null, history.get(history
            .size() - 1));
        GitNote gitNote = new GitNote(noteRef, text);
        list.add(gitNote);
        continue;
      }

      // folder structure
      StringBuilder sb = new StringBuilder(commit.getName());
      sb.insert(2, '/');
      notePath = sb.toString();
      text = getStringContent(repository, notesTree, notePath);
      if (!StringUtils.isEmpty(text)) {
        List<RevCommit> history = getRevLog(repository, notesRef.getName(), notePath, 0, -1);
        RefModel noteRef = new RefModel(notesRef.displayName, null, history.get(history
            .size() - 1));
        GitNote gitNote = new GitNote(noteRef, text);
        list.add(gitNote);
      }
    }
View Full Code Here

TOP

Related Classes of com.gitblit.models.RefModel

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.