Package org.eclipse.jgit.lib

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


            JGitText.get().resettingHead, headName),
            ProgressMonitor.UNKNOWN);

        // update the HEAD
        RefUpdate refUpdate = repo.updateRef(Constants.HEAD, false);
        Result res = refUpdate.link(headName);
        switch (res) {
        case FAST_FORWARD:
        case FORCED:
        case NO_CHANGE:
          break;
View Full Code Here


    FileUtils.mkdir(new File(getDirectory(), "branches"));
    FileUtils.mkdir(new File(getDirectory(), "hooks"));

    RefUpdate head = updateRef(Constants.HEAD);
    head.disableRefLog();
    head.link(Constants.R_HEADS + Constants.MASTER);

    final boolean fileMode;
    if (getFS().supportsExecute()) {
      File tmp = File.createTempFile("try", "execute", getDirectory());
View Full Code Here

        break;
      default:
        throw new JGitInternalException("Updating HEAD failed");
      }
      rup = repo.updateRef(Constants.HEAD);
      res = rup.link(headName);
      switch (res) {
      case FAST_FORWARD:
      case FORCED:
      case NO_CHANGE:
        break;
View Full Code Here

            JGitText.get().resettingHead, headName),
            ProgressMonitor.UNKNOWN);

        // update the HEAD
        RefUpdate refUpdate = repo.updateRef(Constants.HEAD, false);
        Result res = refUpdate.link(headName);
        switch (res) {
        case FAST_FORWARD:
        case FORCED:
        case NO_CHANGE:
          break;
View Full Code Here

        Map<String, Ref> all = git.getAllRefs();
        if (all.keySet().equals(keysOne) || all.keySet().equals(keysTwo)) {
          try {
            RefUpdate update = git.updateRef(Constants.HEAD);
            update.disableRefLog();
            update.link(GitRepositoryManager.REF_CONFIG);
          } catch (IOException err) {
            ui.message("warning: " + name.get() + ": Cannot update HEAD to "
                + GitRepositoryManager.REF_CONFIG + ": " + err.getMessage());
          }
        }
View Full Code Here

      // A repository may be missing if this project existed only to store
      // inheritable permissions. For example 'All-Projects'.
      try {
        git = mgr.createRepository(allProjectsName);
        final RefUpdate u = git.updateRef(Constants.HEAD);
        u.link(GitRepositoryManager.REF_CONFIG);
      } catch (RepositoryNotFoundException err) {
        final String name = allProjectsName.get();
        throw new IOException("Cannot create repository " + name, err);
      }
    }
View Full Code Here

          l.onNewProjectCreated(event);
        }

        final RefUpdate u = repo.updateRef(Constants.HEAD);
        u.disableRefLog();
        u.link(head);

        createProjectConfig();

        if (!createProjectArgs.permissionsOnly
            && createProjectArgs.createEmptyCommit) {
View Full Code Here

    if (branch == null)
      throw die(CLIText.get().cannotChekoutNoHeadsAdvertisedByRemote);
    if (!Constants.HEAD.equals(branch.getName())) {
      RefUpdate u = db.updateRef(Constants.HEAD);
      u.disableRefLog();
      u.link(branch.getName());
    }

    final RevCommit commit = parseCommit(branch);
    final RefUpdate u = db.updateRef(Constants.HEAD);
    u.setNewObjectId(commit);
View Full Code Here

            if (null == masterCommit)
            {
                RefUpdate refUpdate = repo.getRefDatabase().newUpdate(Constants.HEAD, false);
                refUpdate.setForceUpdate(true);
                refUpdate.link(Constants.R_HEADS + context.getMaster());

                git.commit().setMessage("Initial Commit").call();
            }

            //creation of develop
View Full Code Here

      RefUpdate refUpdate = repo.updateRef(Constants.HEAD, ref == null);
      refUpdate.setForceUpdate(force);
      refUpdate.setRefLogMessage(refLogMessage + " to " + toName, false);
      Result updateResult;
      if (ref != null)
        updateResult = refUpdate.link(ref.getName());
      else {
        refUpdate.setNewObjectId(newCommit);
        updateResult = refUpdate.forceUpdate();
      }
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.