text: public void execute(ReceivePack rp) {try {String expTarget = getOldSymref();boolean detach = getNewSymref() != null|| (type == Type.DELETE && expTarget != null);RefUpdate ru = rp.getRepository().updateRef(getRefName(), detach);if (expTarget != null) {if (!ru.getRef().isSymbolic() || !ru.getRef().getTarget().getName().equals(expTarget)) {setResult(Result.LOCK_FAILURE);return;}}ru.setRefLogIdent(rp.getRefLogIdent());ru.setRefLogMessage(refLogMessage, refLogIncludeResult);switch (getType()) {case DELETE:if (!ObjectId.zeroId().equals(getOldId())) {ru.setExpectedOldObjectId(getOldId());}ru.setForceUpdate(true);setResult(ru.delete(rp.getRevWalk()));break;case CREATE:case UPDATE:case UPDATE_NONFASTFORWARD:ru.setForceUpdate(rp.isAllowNonFastForwards());ru.setExpectedOldObjectId(getOldId());ru.setRefLogMessage("push", true); if (getNewSymref() != null) {setResult(ru.link(getNewSymref()));} else {ru.setNewObjectId(getNewId());setResult(ru.update(rp.getRevWalk()));}break;}} catch (IOException err) {reject(err);}}