@Override public void write(ResponseWriter out) throws Exception { out.start(); out.writeElement("Push", "Success"); out.writeElement("dataPushed", String.valueOf(!dataPushed.isEmpty())); out.finish(); } });
if (dataPushed.isEmpty()) { cli.getConsole().println("Nothing to push.");
if (dataPushed.isEmpty()) { cli.getConsole().println("Nothing to push.");
if (dataPushed.isEmpty()) { cli.getConsole().println("Nothing to push.");
@Test public void testFetchNoChanges() throws Exception { // fetch from the remote FetchOp fetch = fetchOp(); TransferSummary summary = fetch.addRemote("origin").call(); assertEquals(1, summary.getRefDiffs().size()); assertTrue(summary.getRefDiffs().containsKey(origin.getFetchURL())); assertSummary(summary, origin.getFetchURL(), localOriginMaster, originMaster); assertSummary(summary, origin.getFetchURL(), absent(), originBranch1); assertSummary(summary, origin.getFetchURL(), absent(), originTag); verifyFetch(); // fetch again summary = fetch.call(); assertTrue(summary.toString(), summary.isEmpty()); }
@Test public void testFetchNoChanges() throws Exception { // fetch from the remote FetchOp fetch = fetchOp(); TransferSummary summary = fetch.addRemote("origin").call(); assertEquals(1, summary.getRefDiffs().size()); assertTrue(summary.getRefDiffs().containsKey(origin.getFetchURL())); assertSummary(summary, origin.getFetchURL(), localOriginMaster, originMaster); assertSummary(summary, origin.getFetchURL(), absent(), originBranch1); assertSummary(summary, origin.getFetchURL(), absent(), originTag); verifyFetch(); // fetch again summary = fetch.call(); assertTrue(summary.toString(), summary.isEmpty()); }
@Test public void testNothingToPush() throws Exception { Optional<Ref> master = getRef(remoteRepo, "master"); Optional<Ref> branch = getRef(remoteRepo, "Branch1"); // Push the commit PushOp push = pushOp(); TransferSummary summary = push.setProgressListener(SIMPLE_PROGRESS).call(); assertTrue(summary.isEmpty()); assertEquals(master, getRef(remoteRepo, "master")); assertEquals(branch, getRef(remoteRepo, "Branch1")); }
@Test public void testNothingToPush() throws Exception { Optional<Ref> master = getRef(remoteRepo, "master"); Optional<Ref> branch = getRef(remoteRepo, "Branch1"); // Push the commit PushOp push = pushOp(); TransferSummary summary = push.setProgressListener(SIMPLE_PROGRESS).call(); assertTrue(summary.isEmpty()); assertEquals(master, getRef(remoteRepo, "master")); assertEquals(branch, getRef(remoteRepo, "Branch1")); }