final ObjectId expected = leaseSpec == null ? null : db.resolve(leaseSpec.getExpected()); final RemoteRefUpdate rru = new RemoteRefUpdate(db, srcSpec, destSpec, forceUpdate, localName, expected); result.add(rru);
static Collection<RemoteRefUpdate> copyUpdates( final Collection<RemoteRefUpdate> refUpdates) throws IOException { final Collection<RemoteRefUpdate> copy = new ArrayList<RemoteRefUpdate>( refUpdates.size()); for (final RemoteRefUpdate rru : refUpdates) copy.add(new RemoteRefUpdate(rru, null)); return copy; }
protected static Collection<RemoteRefUpdate> push(TestRepository from, RevCommit q) throws IOException { final Repository db = from.getRepository(); final String srcExpr = q.name(); final String dstName = master; final boolean forceUpdate = true; final String localName = null; final ObjectId oldId = null; RemoteRefUpdate u = new RemoteRefUpdate(db, srcExpr, dstName, forceUpdate, localName, oldId); return Collections.singleton(u); }
/** * Push a commit * * @param from * @param q * @return collection of RefUpdates * @throws IOException */ protected static Collection<RemoteRefUpdate> push(TestRepository from, RevCommit q) throws IOException { final Repository db = from.getRepository(); final String srcExpr = q.name(); final String dstName = master; final boolean forceUpdate = true; final String localName = null; final ObjectId oldId = null; RemoteRefUpdate u = new RemoteRefUpdate(db, srcExpr, dstName, forceUpdate, localName, oldId); return Collections.singleton(u); }
+ targetRefName); refsToUpdate.add(new RemoteRefUpdate(repo, candidateRef, targetRefName, true, null, null));
final RemoteRefUpdate rru = new RemoteRefUpdate(db, srcSpec, destSpec, forceUpdate, localName, null); result.add(rru);
final ObjectId expected = leaseSpec == null ? null : db.resolve(leaseSpec.getExpected()); final RemoteRefUpdate rru = new RemoteRefUpdate(db, srcSpec, destSpec, forceUpdate, localName, expected); result.add(rru);
void doPush(IProgressMonitor monitor) { try { int timeout = Activator.getDefault().getPreferenceStore() .getInt(UIPreferences.REMOTE_CONNECTION_TIMEOUT); URIish uri = new URIish(uriCombo.getText()); Ref currentHead = repository.getRef(Constants.HEAD); RemoteRefUpdate update = new RemoteRefUpdate(repository, currentHead, prefixCombo.getItem(prefixCombo .getSelectionIndex()) + branchText.getText(), false, null, null); PushOperationSpecification spec = new PushOperationSpecification(); spec.addURIRefUpdates(uri, Arrays.asList(update)); PushOperationUI op = new PushOperationUI(repository, spec, timeout, false); op.setCredentialsProvider(new EGitCredentialsProvider()); PushOperationResult result = op.execute(monitor); PushResultDialog dlg = new PushResultDialog(getShell(), repository, result, op.getDestinationString()); dlg.showConfigureButton(false); dlg.open(); storeLastUsedUri(uriCombo.getText()); storeLastUsedBranch(branchText.getText()); } catch (CoreException e) { Activator.handleError(e.getMessage(), e, true); } catch (URISyntaxException e) { Activator.handleError(e.getMessage(), e, true); } catch (IOException e) { Activator.handleError(e.getMessage(), e, true); } }