GitHubNotebookRepo extends GitNotebookRepo { @Override public Revision checkpoint(String noteId, String notePath, String commitMessage, AuthenticationInfo subject) throws IOException { Revision revision = super.checkpoint(noteId, notePath, commitMessage, subject); updateRemoteStream(); return revision; }  @Override void init(ZeppelinConfiguration conf); @Override Revision checkpoint(String noteId,
                             String notePath,
                             String commitMessage,
                             AuthenticationInfo subject);  }
@Test public void pullChangesFromRemoteRepositoryOnCheckpointing() throws GitAPIException, IOException { RevCommit secondCommitRevision = remoteGit.commit().setMessage("Second commit from remote repository").call(); addParagraphToNotebook(); NotebookRepoWithVersionControl.Revision thirdCommitRevision = gitHubNotebookRepo.checkpoint( TEST_NOTE_ID, TEST_NOTE_PATH, "Third commit from local repository", null); Iterator<RevCommit> revisions = gitHubNotebookRepo.getGit().log().all().call().iterator(); revisions.next(); assert(thirdCommitRevision.id.equals(revisions.next().getName())); assert(secondCommitRevision.getName().equals(revisions.next().getName())); assert(firstCommitRevision.getName().equals(revisions.next().getName())); }
@Test public void pushLocalChangesToRemoteRepositoryOnCheckpointing() throws IOException, GitAPIException { addParagraphToNotebook(); NotebookRepoWithVersionControl.Revision secondCommitRevision = gitHubNotebookRepo.checkpoint( TEST_NOTE_ID, TEST_NOTE_PATH, "Second commit from local repository", null); Iterator<RevCommit> revisions = remoteGit.log().all().call().iterator(); assert(secondCommitRevision.id.equals(revisions.next().getName())); assert(firstCommitRevision.getName().equals(revisions.next().getName())); }