@Override public void pushNewData(Repository local, Ref ref, String refspec, ProgressListener progress) throws SynchronizationException { Optional<Ref> remoteRef = getRemoteRef(refspec); checkPush(local, ref, remoteRef); beginPush(); PushCommitGatherer gatherer = new PushCommitGatherer(local); try { gatherer.traverse(ref.getObjectId()); Stack<ObjectId> needed = gatherer.commits; while (!needed.isEmpty()) { ObjectId commitToPush = needed.pop(); pushSparseCommit(local, commitToPush); } ObjectId newCommitId = local.graphDatabase().getMapping(ref.getObjectId()); ObjectId originalRemoteRefValue = ObjectId.NULL; if (remoteRef.isPresent()) { originalRemoteRefValue = remoteRef.get().getObjectId(); } endPush(refspec, newCommitId, originalRemoteRefValue.toString()); } catch (Exception e) { Throwables.propagate(e); } finally { } }
@Override public void pushNewData(Repository local, Ref ref, String refspec, ProgressListener progress) throws SynchronizationException { Optional<Ref> remoteRef = getRemoteRef(refspec); checkPush(local, ref, remoteRef); beginPush(); PushCommitGatherer gatherer = new PushCommitGatherer(local); gatherer.traverse(ref.getObjectId()); Stack<ObjectId> needed = gatherer.commits; while (!needed.isEmpty()) { ObjectId commitToPush = needed.pop(); pushSparseCommit(local, commitToPush); } ObjectId newCommitId = local.graphDatabase().getMapping(ref.getObjectId()); ObjectId originalRemoteRefValue = ObjectId.NULL; if (remoteRef.isPresent()) { originalRemoteRefValue = remoteRef.get().getObjectId(); } endPush(refspec, newCommitId, originalRemoteRefValue.toString()); }