Package org.eclipse.jgit.lib

Examples of org.eclipse.jgit.lib.CheckoutEntry


    setupReflog("logs/HEAD", switchBranch);
    List<ReflogEntry> entries = db.getReflogReader(Constants.HEAD)
        .getReverseEntries();
    assertEquals(1, entries.size());
    ReflogEntry entry = entries.get(0);
    CheckoutEntry checkout = entry.parseCheckout();
    assertNotNull(checkout);
    assertEquals("master", checkout.getToBranch());
    assertEquals("new/work", checkout.getFromBranch());
  }
View Full Code Here


        ReflogReader reflogReader = repository.getReflogReader(Constants.HEAD);
        if (reflogReader != null) {
          List<ReflogEntry> lastEntry = reflogReader.getReverseEntries();
          for (ReflogEntry entry : lastEntry) {
            if (entry.getNewId().name().equals(commitId)) {
              CheckoutEntry checkoutEntry = entry.parseCheckout();
              if (checkoutEntry != null) {
                Ref ref = repository.getRef(checkoutEntry.getToBranch());
                if (ref != null) {
                  if (ref.getObjectId().getName()
                      .equals(commitId))
                    return checkoutEntry.getToBranch();
                  ref = repository.peel(ref);
                }
                if (ref != null) {
                  ObjectId id = ref.getPeeledObjectId();
                  if (id != null && id.getName().equals(commitId))
                    return checkoutEntry.getToBranch();
                }
              }
            }
          }
        }
View Full Code Here

      // Add the MAX_NUM_MENU_ENTRIES most recently used branches first
      List<ReflogEntry> reflogEntries = repository.getReflogReader(
          Constants.HEAD).getReverseEntries();
      for (ReflogEntry entry : reflogEntries) {
        CheckoutEntry checkout = entry.parseCheckout();
        if (checkout != null) {
          Ref ref = localBranches.get(checkout.getFromBranch());
          if (ref != null)
            if (sortedRefs.size() < MAX_NUM_MENU_ENTRIES)
              sortedRefs.put(checkout.getFromBranch(), ref);
          ref = localBranches.get(checkout.getToBranch());
          if (ref != null)
            if (sortedRefs.size() < MAX_NUM_MENU_ENTRIES)
              sortedRefs.put(checkout.getToBranch(), ref);
        }
      }

      // Add the recently used branches to the menu, in alphabetical order
      int itemCount = 0;
View Full Code Here

TOP

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

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.