/** * Create a command to update, create or delete a ref in this repository. * * @param ref * name of the ref the caller wants to modify. * @param detach * true to create a detached head * @return an update command. The caller must finish populating this command * and then invoke one of the update methods to actually make a * change. * @throws java.io.IOException * a symbolic ref was passed in and could not be resolved back * to the base ref, as the symbolic ref could not be read. */ @NonNull public RefUpdate updateRef(String ref, boolean detach) throws IOException { return getRefDatabase().newUpdate(ref, detach); }
/** {@inheritDoc} */ @Override public RefUpdate newUpdate(String name, boolean detach) throws IOException { if (!repo.isBare() && name.indexOf('/') < 0 && !HEAD.equals(name)) { return bootstrap.newUpdate(name, detach); } if (conflictsWithBootstrap(name)) { return new AlwaysFailUpdate(this, name); } Ref r = exactRef(name); if (r == null) { r = new ObjectIdRef.Unpeeled(Storage.NEW, name, null); } boolean detaching = detach && r.isSymbolic(); if (detaching) { r = new ObjectIdRef.Unpeeled(LOOSE, name, r.getObjectId()); } RefTreeUpdate u = new RefTreeUpdate(this, r); if (detaching) { u.setDetachingSymbolicRef(); } return u; }
RefUpdate ru = refdb.newUpdate(cmd.getRefName(), false); if (isRefLogDisabled(cmd)) { ru.disableRefLog();
/** * Create a command to update, create or delete a ref in this repository. * * @param ref * name of the ref the caller wants to modify. * @param detach * true to create a detached head * @return an update command. The caller must finish populating this command * and then invoke one of the update methods to actually make a * change. * @throws IOException * a symbolic ref was passed in and could not be resolved back * to the base ref, as the symbolic ref could not be read. */ @NonNull public RefUpdate updateRef(final String ref, final boolean detach) throws IOException { return getRefDatabase().newUpdate(ref, detach); }
/** * Create a command to update, create or delete a ref in this repository. * * @param ref * name of the ref the caller wants to modify. * @param detach * true to create a detached head * @return an update command. The caller must finish populating this command * and then invoke one of the update methods to actually make a * change. * @throws java.io.IOException * a symbolic ref was passed in and could not be resolved back * to the base ref, as the symbolic ref could not be read. */ @NonNull public RefUpdate updateRef(String ref, boolean detach) throws IOException { return getRefDatabase().newUpdate(ref, detach); }
public void createGitNotesRef(Git git) throws IOException { RefUpdate ru = git.getRepository().getRefDatabase().newUpdate(GIT_NOTES_REF, true); ru.setNewObjectId(getBaseObjectId(git)); ru.update(); }
@Override public RefUpdate newUpdate(String name, boolean detach) throws IOException { if (!repo.isBare() && name.indexOf('/') < 0 && !HEAD.equals(name)) { return bootstrap.newUpdate(name, detach); } if (conflictsWithBootstrap(name)) { return new AlwaysFailUpdate(this, name); } Ref r = exactRef(name); if (r == null) { r = new ObjectIdRef.Unpeeled(Storage.NEW, name, null); } boolean detaching = detach && r.isSymbolic(); if (detaching) { r = new ObjectIdRef.Unpeeled(LOOSE, name, r.getObjectId()); } RefTreeUpdate u = new RefTreeUpdate(this, r); if (detaching) { u.setDetachingSymbolicRef(); } return u; }
/** {@inheritDoc} */ @Override public RefUpdate newUpdate(String name, boolean detach) throws IOException { if (!repo.isBare() && name.indexOf('/') < 0 && !HEAD.equals(name)) { return bootstrap.newUpdate(name, detach); } if (conflictsWithBootstrap(name)) { return new AlwaysFailUpdate(this, name); } Ref r = exactRef(name); if (r == null) { r = new ObjectIdRef.Unpeeled(Storage.NEW, name, null); } boolean detaching = detach && r.isSymbolic(); if (detaching) { r = new ObjectIdRef.Unpeeled(LOOSE, name, r.getObjectId()); } RefTreeUpdate u = new RefTreeUpdate(this, r); if (detaching) { u.setDetachingSymbolicRef(); } return u; }
RefUpdate update = refDb.newUpdate(txnCommitted, true); ObjectId oldTreeId;
final RefUpdate refUpdate = bootstrap.newUpdate(refdb.getTxnCommitted(), false);
RefUpdate ru = refdb.newUpdate(cmd.getRefName(), false); if (isRefLogDisabled()) ru.disableRefLog();
RefUpdate ru = refdb.newUpdate(cmd.getRefName(), false); if (isRefLogDisabled(cmd)) { ru.disableRefLog();
RefUpdate refUpdate = repo.getRefDatabase().newUpdate(Constants.HEAD, false); refUpdate.setForceUpdate(true); refUpdate.link(Constants.R_HEADS + context.getMaster());
RefUpdate refUpdate = repo.getRefDatabase().newUpdate(Constants.HEAD, false); refUpdate.setForceUpdate(true); refUpdate.link(Constants.R_HEADS + context.getMaster());
RefUpdate refUpdate = repo.getRefDatabase().newUpdate(Constants.HEAD, false); refUpdate.setForceUpdate(true); refUpdate.link(Constants.R_HEADS + context.getMaster());