Package org.eclipse.jgit.lib

Examples of org.eclipse.jgit.lib.RefUpdate.update()


        RefUpdate rup = repo.updateRef(headName);
        rup.setExpectedOldObjectId(oldCommit);
        rup.setNewObjectId(newCommit);
        rup.setRefLogMessage("Fast-foward from " + oldCommit.name()
            + " to " + newCommit.name(), false);
        Result res = rup.update(walk);
        switch (res) {
        case FAST_FORWARD:
        case NO_CHANGE:
        case FORCED:
          break;
View Full Code Here


          String refName = Constants.R_TAGS + newTag.getTag();
          RefUpdate tagRef = repo.updateRef(refName);
          tagRef.setNewObjectId(tagId);
          tagRef.setForceUpdate(forceUpdate);
          tagRef.setRefLogMessage("tagged " + name, false);
          Result updateResult = tagRef.update(revWalk);
          switch (updateResult) {
          case NEW:
          case FORCED:
            return repo.getRef(refName);
          case LOCK_FAILURE:
View Full Code Here

        RefUpdate rup = repo.updateRef(headName);
        rup.setExpectedOldObjectId(oldCommit);
        rup.setNewObjectId(newCommit);
        rup.setRefLogMessage("Fast-foward from " + oldCommit.name()
            + " to " + newCommit.name(), false);
        Result res = rup.update(walk);
        switch (res) {
        case FAST_FORWARD:
        case NO_CHANGE:
        case FORCED:
          break;
View Full Code Here

    int remainingLockFailureCalls = MAX_LOCK_FAILURE_CALLS;
    RefUpdate refUpdate = createRefUpdate(repo, oursCommit, baseCommit);

    for (;;) {
      final Result result = refUpdate.update();

      if (result == Result.LOCK_FAILURE) {
        if (--remainingLockFailureCalls > 0) {
          Thread.sleep(SLEEP_ON_LOCK_FAILURE_MS);
        } else {
View Full Code Here

      rfu.setExpectedOldObjectId(currentCommitId);
      rfu
          .setRefLogMessage("Submit to " + subscriber.getParentKey().get(),
              true);

      switch (rfu.update()) {
        case NEW:
        case FAST_FORWARD:
          replication.fire(subscriber.getParentKey(), rfu.getName());
          // TODO since this is performed "in the background" no mail will be
          // sent to inform users about the updated branch
View Full Code Here

        }

        RefUpdate ru = db.updateRef(refName);
        ru.setExpectedOldObjectId(ObjectId.zeroId());
        ru.setNewObjectId(src);
        RefUpdate.Result result = ru.update();
        switch (result) {
          case NEW:
            revision = rw.parseCommit(ru.getNewObjectId());
            update.replicate(ru.getName());
            return revision;
View Full Code Here

        }
        ru.setNewObjectId(src);
        ru.disableRefLog();
        inserter.flush();

        switch (ru.update(rw)) {
          case NEW:
          case FAST_FORWARD:
            revision = rw.parseCommit(ru.getNewObjectId());
            update.replicate(ru.getName());
            return revision;
View Full Code Here

      oi.flush();

      for (String ref : refs) {
        RefUpdate ru = repo.updateRef(ref);
        ru.setNewObjectId(id);
        final Result result = ru.update();
        switch (result) {
          case NEW:
            referenceUpdated.fire(project, ref);
            break;
          default: {
View Full Code Here

        final RefUpdate u = repo.updateRef(refname);
        u.setExpectedOldObjectId(ObjectId.zeroId());
        u.setNewObjectId(object.copy());
        u.setRefLogIdent(identifiedUser.newRefLogIdent());
        u.setRefLogMessage("created via web from " + startingRevision, false);
        final RefUpdate.Result result = u.update(rw);
        switch (result) {
          case FAST_FORWARD:
          case NEW:
          case NO_CHANGE:
            referenceUpdated.fire(name.getParentKey(), refname);
View Full Code Here

    }

    final RefUpdate ru = repo.updateRef(ps.getRefName());
    ru.setNewObjectId(c);
    ru.disableRefLog();
    if (ru.update(walk) != RefUpdate.Result.NEW) {
      throw new IOException("Failed to create ref " + ps.getRefName() + " in "
          + repo.getDirectory() + ": " + ru.getResult());
    }
    replication.fire(project.getNameKey(), ru.getName());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.