├── .dockerignore ├── .github └── dependabot.yml ├── .gitignore ├── Dockerfile ├── LICENSE ├── Makefile ├── README.md ├── conf ├── envsubst_template.json ├── example_config.json └── local.json ├── lib └── newrelic.jar ├── newrelic.yml ├── pom.xml ├── src ├── main │ ├── java │ │ └── uk │ │ │ └── ac │ │ │ └── ic │ │ │ └── wlgitbridge │ │ │ ├── Main.java │ │ │ ├── application │ │ │ ├── GitBridgeApp.java │ │ │ ├── config │ │ │ │ ├── Config.java │ │ │ │ └── Oauth2.java │ │ │ ├── exception │ │ │ │ ├── ArgsException.java │ │ │ │ └── ConfigFileException.java │ │ │ └── jetty │ │ │ │ └── NullLogger.java │ │ │ ├── bridge │ │ │ ├── Bridge.java │ │ │ ├── db │ │ │ │ ├── DBInitException.java │ │ │ │ ├── DBStore.java │ │ │ │ ├── ProjectState.java │ │ │ │ ├── noop │ │ │ │ │ └── NoopDbStore.java │ │ │ │ └── sqlite │ │ │ │ │ ├── SQLQuery.java │ │ │ │ │ ├── SQLUpdate.java │ │ │ │ │ ├── SqliteDBStore.java │ │ │ │ │ ├── query │ │ │ │ │ ├── GetLatestVersionForProjectSQLQuery.java │ │ │ │ │ ├── GetNumProjects.java │ │ │ │ │ ├── GetNumUnswappedProjects.java │ │ │ │ │ ├── GetOldestProjectName.java │ │ │ │ │ ├── GetPathForURLInProjectSQLQuery.java │ │ │ │ │ ├── GetProjectNamesSQLQuery.java │ │ │ │ │ ├── GetProjectState.java │ │ │ │ │ ├── GetSwapCompression.java │ │ │ │ │ ├── LastAccessedColumnExists.java │ │ │ │ │ ├── RestoreTimeColumnExists.java │ │ │ │ │ ├── SwapCompressionColumnExists.java │ │ │ │ │ └── SwapTimeColumnExists.java │ │ │ │ │ └── update │ │ │ │ │ ├── alter │ │ │ │ │ ├── ProjectsAddLastAccessed.java │ │ │ │ │ ├── ProjectsAddRestoreTime.java │ │ │ │ │ ├── ProjectsAddSwapCompression.java │ │ │ │ │ ├── ProjectsAddSwapTime.java │ │ │ │ │ └── SetSoftHeapLimitPragma.java │ │ │ │ │ ├── create │ │ │ │ │ ├── CreateIndexURLIndexStore.java │ │ │ │ │ ├── CreateProjectsIndexLastAccessed.java │ │ │ │ │ ├── CreateProjectsTableSQLUpdate.java │ │ │ │ │ └── CreateURLIndexStoreSQLUpdate.java │ │ │ │ │ ├── delete │ │ │ │ │ └── DeleteFilesForProjectSQLUpdate.java │ │ │ │ │ └── insert │ │ │ │ │ ├── AddURLIndexSQLUpdate.java │ │ │ │ │ ├── SetProjectLastAccessedTime.java │ │ │ │ │ ├── SetProjectSQLUpdate.java │ │ │ │ │ ├── UpdateRestore.java │ │ │ │ │ └── UpdateSwap.java │ │ │ ├── gc │ │ │ │ ├── GcJob.java │ │ │ │ └── GcJobImpl.java │ │ │ ├── lock │ │ │ │ ├── LockGuard.java │ │ │ │ └── ProjectLock.java │ │ │ ├── repo │ │ │ │ ├── FSGitRepoStore.java │ │ │ │ ├── GitProjectRepo.java │ │ │ │ ├── NoGitignoreIterator.java │ │ │ │ ├── ProjectRepo.java │ │ │ │ ├── RepoStore.java │ │ │ │ ├── RepoStoreConfig.java │ │ │ │ └── WalkOverrideGitRepo.java │ │ │ ├── resource │ │ │ │ ├── ResourceCache.java │ │ │ │ └── UrlResourceCache.java │ │ │ ├── snapshot │ │ │ │ ├── NetSnapshotApi.java │ │ │ │ ├── SnapshotApi.java │ │ │ │ └── SnapshotApiFacade.java │ │ │ ├── swap │ │ │ │ ├── job │ │ │ │ │ ├── NoopSwapJob.java │ │ │ │ │ ├── SwapJob.java │ │ │ │ │ ├── SwapJobConfig.java │ │ │ │ │ └── SwapJobImpl.java │ │ │ │ └── store │ │ │ │ │ ├── InMemorySwapStore.java │ │ │ │ │ ├── NoopSwapStore.java │ │ │ │ │ ├── S3SwapStore.java │ │ │ │ │ ├── SwapStore.java │ │ │ │ │ └── SwapStoreConfig.java │ │ │ └── util │ │ │ │ └── CastUtil.java │ │ │ ├── data │ │ │ ├── CandidateSnapshot.java │ │ │ ├── LockAllWaiter.java │ │ │ ├── ProjectLockImpl.java │ │ │ ├── ServletFile.java │ │ │ ├── filestore │ │ │ │ ├── GitDirectoryContents.java │ │ │ │ ├── RawDirectory.java │ │ │ │ ├── RawFile.java │ │ │ │ └── RepositoryFile.java │ │ │ └── model │ │ │ │ └── Snapshot.java │ │ │ ├── git │ │ │ ├── exception │ │ │ │ ├── FileLimitExceededException.java │ │ │ │ ├── GitUserException.java │ │ │ │ ├── InvalidGitRepository.java │ │ │ │ ├── SizeLimitExceededException.java │ │ │ │ └── SnapshotAPIException.java │ │ │ ├── handler │ │ │ │ ├── WLReceivePackFactory.java │ │ │ │ ├── WLRepositoryResolver.java │ │ │ │ ├── WLUploadPackFactory.java │ │ │ │ └── hook │ │ │ │ │ ├── WriteLatexPutHook.java │ │ │ │ │ └── exception │ │ │ │ │ ├── ForcedPushException.java │ │ │ │ │ └── WrongBranchException.java │ │ │ ├── servlet │ │ │ │ ├── WLGitServlet.java │ │ │ │ └── WLGitServletConfig.java │ │ │ └── util │ │ │ │ └── RepositoryObjectTreeWalker.java │ │ │ ├── io │ │ │ └── http │ │ │ │ └── ning │ │ │ │ ├── NingHttpClient.java │ │ │ │ └── NingHttpClientFacade.java │ │ │ ├── server │ │ │ ├── DiagnosticsHandler.java │ │ │ ├── FileHandler.java │ │ │ ├── GitBridgeServer.java │ │ │ ├── GitLfsHandler.java │ │ │ ├── HealthCheckHandler.java │ │ │ ├── Oauth2Filter.java │ │ │ ├── PostbackContents.java │ │ │ ├── PostbackHandler.java │ │ │ ├── ProductionErrorHandler.java │ │ │ ├── PrometheusHandler.java │ │ │ └── StatusHandler.java │ │ │ ├── snapshot │ │ │ ├── base │ │ │ │ ├── ForbiddenException.java │ │ │ │ ├── HTTPMethod.java │ │ │ │ ├── JSONSource.java │ │ │ │ ├── MissingRepositoryException.java │ │ │ │ ├── Request.java │ │ │ │ ├── Result.java │ │ │ │ └── SnapshotAPIRequest.java │ │ │ ├── exception │ │ │ │ └── FailedConnectionException.java │ │ │ ├── getdoc │ │ │ │ ├── GetDocRequest.java │ │ │ │ ├── GetDocResult.java │ │ │ │ └── exception │ │ │ │ │ └── InvalidProjectException.java │ │ │ ├── getforversion │ │ │ │ ├── GetForVersionRequest.java │ │ │ │ ├── GetForVersionResult.java │ │ │ │ ├── SnapshotAttachment.java │ │ │ │ ├── SnapshotData.java │ │ │ │ └── SnapshotFile.java │ │ │ ├── getsavedvers │ │ │ │ ├── GetSavedVersRequest.java │ │ │ │ ├── GetSavedVersResult.java │ │ │ │ ├── SnapshotInfo.java │ │ │ │ └── WLUser.java │ │ │ ├── push │ │ │ │ ├── PostbackManager.java │ │ │ │ ├── PostbackPromise.java │ │ │ │ ├── PushRequest.java │ │ │ │ ├── PushResult.java │ │ │ │ └── exception │ │ │ │ │ ├── InternalErrorException.java │ │ │ │ │ ├── InvalidFilesException.java │ │ │ │ │ ├── InvalidPostbackKeyException.java │ │ │ │ │ ├── InvalidProjectException.java │ │ │ │ │ ├── OutOfDateException.java │ │ │ │ │ ├── PostbackTimeoutException.java │ │ │ │ │ ├── SevereSnapshotPostException.java │ │ │ │ │ ├── SnapshotPostException.java │ │ │ │ │ ├── SnapshotPostExceptionBuilder.java │ │ │ │ │ ├── UnexpectedErrorException.java │ │ │ │ │ └── UnexpectedPostbackException.java │ │ │ └── servermock │ │ │ │ ├── Main.java │ │ │ │ ├── exception │ │ │ │ └── InvalidAPICallException.java │ │ │ │ ├── response │ │ │ │ ├── SnapshotResponse.java │ │ │ │ ├── SnapshotResponseBuilder.java │ │ │ │ ├── getdoc │ │ │ │ │ └── SnapshotGetDocResponse.java │ │ │ │ ├── getforver │ │ │ │ │ └── SnapshotGetForVerResponse.java │ │ │ │ ├── getsavedver │ │ │ │ │ └── SnapshotGetSavedVersResponse.java │ │ │ │ └── push │ │ │ │ │ ├── SnapshotPushResponse.java │ │ │ │ │ ├── data │ │ │ │ │ ├── SnapshotPushResult.java │ │ │ │ │ ├── SnapshotPushResultOutOfDate.java │ │ │ │ │ └── SnapshotPushResultSuccess.java │ │ │ │ │ └── postback │ │ │ │ │ ├── SnapshotPostbackRequest.java │ │ │ │ │ ├── SnapshotPostbackRequestError.java │ │ │ │ │ ├── SnapshotPostbackRequestInvalidFiles.java │ │ │ │ │ ├── SnapshotPostbackRequestInvalidProject.java │ │ │ │ │ ├── SnapshotPostbackRequestOutOfDate.java │ │ │ │ │ ├── SnapshotPostbackRequestSuccess.java │ │ │ │ │ └── invalidfile │ │ │ │ │ ├── InvalidFileError.java │ │ │ │ │ ├── InvalidFileErrorDefault.java │ │ │ │ │ ├── InvalidFileErrorDisallowed.java │ │ │ │ │ └── InvalidFileErrorUnclean.java │ │ │ │ ├── server │ │ │ │ ├── MockSnapshotRequestHandler.java │ │ │ │ ├── MockSnapshotServer.java │ │ │ │ └── PostbackThread.java │ │ │ │ ├── state │ │ │ │ ├── SnapshotAPIState.java │ │ │ │ └── SnapshotAPIStateBuilder.java │ │ │ │ └── util │ │ │ │ └── FileUtil.java │ │ │ └── util │ │ │ ├── BiConsumerT.java │ │ │ ├── DeletingFileInputStream.java │ │ │ ├── Files.java │ │ │ ├── FunctionT.java │ │ │ ├── Instance.java │ │ │ ├── Log.java │ │ │ ├── Project.java │ │ │ ├── ResourceUtil.java │ │ │ ├── Tar.java │ │ │ ├── TimerUtils.java │ │ │ └── Util.java │ └── resources │ │ └── logback.xml └── test │ ├── java │ └── uk │ │ └── ac │ │ └── ic │ │ └── wlgitbridge │ │ ├── application │ │ ├── WLGitBridgeIntegrationTest.java │ │ └── config │ │ │ └── ConfigTest.java │ │ ├── bridge │ │ ├── BridgeTest.java │ │ ├── db │ │ │ └── sqlite │ │ │ │ ├── SqliteDBStoreTest.java │ │ │ │ └── update │ │ │ │ └── delete │ │ │ │ └── DeleteFilesForProjectSQLUpdateTest.java │ │ ├── gc │ │ │ └── GcJobImplTest.java │ │ ├── repo │ │ │ ├── FSGitRepoStoreTest.java │ │ │ └── GitProjectRepoTest.java │ │ ├── resource │ │ │ └── UrlResourceCacheTest.java │ │ └── swap │ │ │ ├── job │ │ │ └── SwapJobImplTest.java │ │ │ └── store │ │ │ ├── InMemorySwapStoreTest.java │ │ │ └── S3SwapStoreTest.java │ │ ├── data │ │ └── model │ │ │ └── ResourceFetcherTest.java │ │ ├── snapshot │ │ ├── push │ │ │ └── PostbackManagerTest.java │ │ └── servermock │ │ │ └── util │ │ │ └── FileUtilTest.java │ │ └── util │ │ ├── ProjectTest.java │ │ ├── TarTest.java │ │ └── TimerUtilsTest.java │ └── resources │ ├── logback-test.xml │ └── uk │ └── ac │ └── ic │ └── wlgitbridge │ ├── WLGitBridgeIntegrationTest │ ├── canCloneAMigratedRepositoryWithoutChanges │ │ └── state │ │ │ ├── state.json │ │ │ └── testproj_no_change │ │ │ └── main.tex │ ├── canCloneARepository │ │ └── state │ │ │ ├── state.json │ │ │ └── testproj │ │ │ ├── foo │ │ │ └── bar │ │ │ │ └── test.tex │ │ │ ├── main.tex │ │ │ └── min_mean_wait_evm_7_eps_150dpi.png │ ├── canCloneDuplicateBinaryFiles │ │ └── state │ │ │ ├── state.json │ │ │ └── testproj │ │ │ ├── main.tex │ │ │ ├── overleaf-white-410-copy.png │ │ │ ├── overleaf-white-410.png │ │ │ └── test.tex │ ├── canCloneMultipleRepositories │ │ └── state │ │ │ ├── state.json │ │ │ ├── testproj1 │ │ │ ├── foo │ │ │ │ └── bar │ │ │ │ │ └── test.tex │ │ │ ├── main.tex │ │ │ └── overleaf-white-410.png │ │ │ └── testproj2 │ │ │ ├── editor-versions-a7e4de19d015c3e7477e3f7eaa6c418e.png │ │ │ ├── foo │ │ │ └── bar │ │ │ │ └── test.tex │ │ │ └── main.tex │ ├── canMigrateRepository │ │ └── state │ │ │ ├── state.json │ │ │ └── testproj │ │ │ ├── foo │ │ │ └── bar │ │ │ │ └── test.tex │ │ │ ├── main.tex │ │ │ └── min_mean_wait_evm_7_eps_150dpi.png │ ├── canPullADeletedBinaryFile │ │ ├── base │ │ │ ├── state.json │ │ │ └── testproj │ │ │ │ ├── main.tex │ │ │ │ ├── overleaf-white-410.png │ │ │ │ └── test.tex │ │ └── withDeletedBinaryFile │ │ │ ├── state.json │ │ │ └── testproj │ │ │ ├── main.tex │ │ │ └── test.tex │ ├── canPullADeletedTexFile │ │ ├── base │ │ │ ├── state.json │ │ │ └── testproj │ │ │ │ ├── main.tex │ │ │ │ ├── overleaf-white-410.png │ │ │ │ └── test.tex │ │ └── withDeletedTexFile │ │ │ ├── state.json │ │ │ └── testproj │ │ │ ├── main.tex │ │ │ └── overleaf-white-410.png │ ├── canPullADuplicateBinaryFile │ │ ├── base │ │ │ ├── state.json │ │ │ └── testproj │ │ │ │ ├── main.tex │ │ │ │ ├── overleaf-white-410.png │ │ │ │ └── test.tex │ │ └── withDuplicateBinaryFile │ │ │ ├── state.json │ │ │ └── testproj │ │ │ ├── main.tex │ │ │ ├── overleaf-white-410-copy.png │ │ │ ├── overleaf-white-410.png │ │ │ └── test.tex │ ├── canPullAModifiedBinaryFile │ │ ├── base │ │ │ ├── state.json │ │ │ └── testproj │ │ │ │ ├── main.tex │ │ │ │ ├── overleaf-white-410.png │ │ │ │ └── test.tex │ │ └── withModifiedBinaryFile │ │ │ ├── state.json │ │ │ └── testproj │ │ │ ├── main.tex │ │ │ ├── overleaf-white-410.png │ │ │ └── test.tex │ ├── canPullAModifiedNestedFile │ │ ├── base │ │ │ ├── state.json │ │ │ └── testproj │ │ │ │ ├── main.tex │ │ │ │ ├── overleaf-white-410.png │ │ │ │ └── test.tex │ │ └── withModifiedNestedFile │ │ │ ├── state.json │ │ │ └── testproj │ │ │ ├── main.tex │ │ │ ├── nest1 │ │ │ ├── nest1.tex │ │ │ └── nest2 │ │ │ │ └── nest2.tex │ │ │ ├── overleaf-white-410.png │ │ │ └── test.tex │ ├── canPullAModifiedTexFile │ │ ├── base │ │ │ ├── state.json │ │ │ └── testproj │ │ │ │ ├── main.tex │ │ │ │ ├── overleaf-white-410.png │ │ │ │ └── test.tex │ │ └── withModifiedTexFile │ │ │ ├── state.json │ │ │ └── testproj │ │ │ ├── main.tex │ │ │ ├── overleaf-white-410.png │ │ │ └── test.tex │ ├── canPullDeletedNestedFiles │ │ ├── base │ │ │ ├── state.json │ │ │ └── testproj │ │ │ │ ├── main.tex │ │ │ │ ├── nest1 │ │ │ │ ├── nest1.tex │ │ │ │ └── nest2 │ │ │ │ │ └── nest2.tex │ │ │ │ ├── overleaf-white-410.png │ │ │ │ └── test.tex │ │ └── withDeletedNestedFiles │ │ │ ├── state.json │ │ │ └── testproj │ │ │ ├── main.tex │ │ │ ├── overleaf-white-410.png │ │ │ └── test.tex │ ├── canPullIgnoredForceAddedFile │ │ ├── base │ │ │ ├── state.json │ │ │ └── testproj │ │ │ │ ├── main.tex │ │ │ │ └── sub │ │ │ │ └── .gitignore │ │ └── withUpdatedMainFile │ │ │ ├── state.json │ │ │ └── testproj │ │ │ ├── main.tex │ │ │ └── sub │ │ │ ├── .gitignore │ │ │ └── one.txt │ ├── canPullUpdatedBinaryFiles │ │ ├── base │ │ │ ├── state.json │ │ │ └── testproj │ │ │ │ ├── main.tex │ │ │ │ ├── overleaf-white-410-copy.png │ │ │ │ ├── overleaf-white-410.png │ │ │ │ └── test.tex │ │ └── withUpdatedBinaryFiles │ │ │ ├── state.json │ │ │ └── testproj │ │ │ ├── main.tex │ │ │ ├── overleaf-white-410-copy.png │ │ │ ├── overleaf-white-410.png │ │ │ └── test.tex │ ├── canPushFilesSuccessfully │ │ └── state │ │ │ ├── state.json │ │ │ └── testproj │ │ │ ├── foo │ │ │ └── bar │ │ │ │ └── test.tex │ │ │ ├── main.tex │ │ │ └── min_mean_wait_evm_7_eps_150dpi.png │ ├── canServePushedFiles │ │ └── state │ │ │ ├── state.json │ │ │ └── testproj │ │ │ └── main.tex │ ├── cannotCloneA4xxProject │ │ └── state │ │ │ └── state.json │ ├── cannotCloneAHasDotGitProject │ │ └── state │ │ │ └── state.json │ ├── cannotCloneAMissingProject │ │ └── state │ │ │ └── state.json │ ├── cannotCloneAProtectedProjectWithoutAuthentication │ │ └── state │ │ │ └── state.json │ ├── pushFailsOnFirstStageOutOfDate │ │ └── state │ │ │ ├── state.json │ │ │ └── testproj │ │ │ ├── foo │ │ │ └── bar │ │ │ │ └── test.tex │ │ │ ├── main.tex │ │ │ └── min_mean_wait_evm_7_eps_150dpi.png │ ├── pushFailsOnInvalidFiles │ │ └── state │ │ │ ├── state.json │ │ │ └── testproj │ │ │ ├── foo │ │ │ └── bar │ │ │ │ └── test.tex │ │ │ ├── main.tex │ │ │ └── min_mean_wait_evm_7_eps_150dpi.png │ ├── pushFailsOnInvalidProject │ │ └── state │ │ │ ├── state.json │ │ │ └── testproj │ │ │ ├── foo │ │ │ └── bar │ │ │ │ └── test.tex │ │ │ ├── main.tex │ │ │ └── min_mean_wait_evm_7_eps_150dpi.png │ ├── pushFailsOnSecondStageOutOfDate │ │ └── state │ │ │ ├── state.json │ │ │ └── testproj │ │ │ ├── foo │ │ │ └── bar │ │ │ │ └── test.tex │ │ │ ├── main.tex │ │ │ └── min_mean_wait_evm_7_eps_150dpi.png │ ├── pushFailsOnUnexpectedError │ │ └── state │ │ │ ├── state.json │ │ │ └── testproj │ │ │ ├── foo │ │ │ └── bar │ │ │ │ └── test.tex │ │ │ ├── main.tex │ │ │ └── min_mean_wait_evm_7_eps_150dpi.png │ ├── pushSubmoduleFailsWithInvalidGitRepo │ │ └── state │ │ │ ├── state.json │ │ │ └── testproj │ │ │ ├── foo │ │ │ └── bar │ │ │ │ └── test.tex │ │ │ ├── main.tex │ │ │ └── min_mean_wait_evm_7_eps_150dpi.png │ ├── pushSucceedsAfterRemovingInvalidFiles │ │ ├── invalidState │ │ │ ├── state.json │ │ │ └── testproj │ │ │ │ └── main.tex │ │ └── validState │ │ │ ├── state.json │ │ │ └── testproj │ │ │ └── main.tex │ ├── rejectV1Repository │ │ └── state │ │ │ ├── 1234bbccddff │ │ │ ├── foo │ │ │ │ └── bar │ │ │ │ │ └── test.tex │ │ │ ├── main.tex │ │ │ └── min_mean_wait_evm_7_eps_150dpi.png │ │ │ └── state.json │ ├── skipMigrationWhenMigratedFromMissing │ │ └── state │ │ │ ├── state.json │ │ │ └── testproj2 │ │ │ ├── foo │ │ │ └── bar │ │ │ │ └── test.tex │ │ │ ├── main.tex │ │ │ └── min_mean_wait_evm_7_eps_150dpi.png │ ├── state.json │ └── wlgbCanSwapProjects │ │ └── state │ │ ├── state.json │ │ ├── testproj1 │ │ ├── foo │ │ │ └── bar │ │ │ │ └── test.tex │ │ ├── main.tex │ │ └── overleaf-white-410.png │ │ └── testproj2 │ │ ├── editor-versions-a7e4de19d015c3e7477e3f7eaa6c418e.png │ │ ├── foo │ │ └── bar │ │ │ └── test.tex │ │ └── main.tex │ ├── bridge │ └── repo │ │ ├── FSGitRepoStoreTest │ │ └── rootdir │ │ │ ├── .wlgb │ │ │ └── wlgb.db │ │ │ ├── idontexist │ │ │ └── idontexist.txt │ │ │ ├── proj1 │ │ │ └── DOTgit │ │ │ │ ├── COMMIT_EDITMSG │ │ │ │ ├── HEAD │ │ │ │ ├── config │ │ │ │ ├── description │ │ │ │ ├── hooks │ │ │ │ ├── applypatch-msg.sample │ │ │ │ ├── commit-msg.sample │ │ │ │ ├── post-update.sample │ │ │ │ ├── pre-applypatch.sample │ │ │ │ ├── pre-commit.sample │ │ │ │ ├── pre-push.sample │ │ │ │ ├── pre-rebase.sample │ │ │ │ ├── prepare-commit-msg.sample │ │ │ │ └── update.sample │ │ │ │ ├── index │ │ │ │ ├── info │ │ │ │ └── exclude │ │ │ │ ├── logs │ │ │ │ ├── HEAD │ │ │ │ └── refs │ │ │ │ │ └── heads │ │ │ │ │ └── master │ │ │ │ ├── objects │ │ │ │ ├── 8b │ │ │ │ │ └── 6f970d184c1e097e6e6bae9b0eb03fec7796bf │ │ │ │ ├── e5 │ │ │ │ │ └── fc0d2678ec7b9bacf0bf514bac035fa371cb6e │ │ │ │ └── f2 │ │ │ │ │ └── 7f21327e2f0f53e9d8afab217fedaeea6a1cee │ │ │ │ └── refs │ │ │ │ └── heads │ │ │ │ └── master │ │ │ └── proj2 │ │ │ └── DOTgit │ │ │ ├── COMMIT_EDITMSG │ │ │ ├── HEAD │ │ │ ├── config │ │ │ ├── description │ │ │ ├── hooks │ │ │ ├── applypatch-msg.sample │ │ │ ├── commit-msg.sample │ │ │ ├── post-update.sample │ │ │ ├── pre-applypatch.sample │ │ │ ├── pre-commit.sample │ │ │ ├── pre-push.sample │ │ │ ├── pre-rebase.sample │ │ │ ├── prepare-commit-msg.sample │ │ │ └── update.sample │ │ │ ├── index │ │ │ ├── info │ │ │ └── exclude │ │ │ ├── logs │ │ │ ├── HEAD │ │ │ └── refs │ │ │ │ └── heads │ │ │ │ └── master │ │ │ ├── objects │ │ │ ├── 6c │ │ │ │ └── 12c073e5702530a9d06b83840d62f8a6621764 │ │ │ ├── 7f │ │ │ │ └── 37654ebf6d0a19650abbcf5db3953b15001d1b │ │ │ └── d8 │ │ │ │ └── 5308af36ff394df8bf063719b2aea26077aaea │ │ │ └── refs │ │ │ └── heads │ │ │ └── master │ │ └── GitProjectRepoTest │ │ └── rootdir │ │ ├── badgitignore │ │ ├── .gitignore │ │ ├── DOTgit │ │ │ ├── COMMIT_EDITMSG │ │ │ ├── HEAD │ │ │ ├── config │ │ │ ├── description │ │ │ ├── hooks │ │ │ │ ├── applypatch-msg.sample │ │ │ │ ├── commit-msg.sample │ │ │ │ ├── post-update.sample │ │ │ │ ├── pre-applypatch.sample │ │ │ │ ├── pre-commit.sample │ │ │ │ ├── pre-push.sample │ │ │ │ ├── pre-rebase.sample │ │ │ │ ├── prepare-commit-msg.sample │ │ │ │ └── update.sample │ │ │ ├── index │ │ │ ├── info │ │ │ │ └── exclude │ │ │ ├── logs │ │ │ │ ├── HEAD │ │ │ │ └── refs │ │ │ │ │ └── heads │ │ │ │ │ └── master │ │ │ ├── objects │ │ │ │ ├── 23 │ │ │ │ │ └── 462c896684e004db23cfab16255e176400643a │ │ │ │ ├── 39 │ │ │ │ │ └── 2f03252185fe21cb8926676deb84b60a617ff9 │ │ │ │ ├── 55 │ │ │ │ │ └── 45880406d44a71c1c179cb17a5819b59cbbc36 │ │ │ │ ├── 71 │ │ │ │ │ └── ebe5d70c8634f7531cc09c1cad5dae951a9052 │ │ │ │ ├── 4a │ │ │ │ │ └── 64431a59519ff25eff2cd94a561081146059b7 │ │ │ │ ├── e6 │ │ │ │ │ └── 9de29bb2d1d6434b8b29ae775ad8c2e48c5391 │ │ │ │ ├── f5 │ │ │ │ │ └── b2fc4665b50e85c1b66594166f218f722a4af2 │ │ │ │ ├── f9 │ │ │ │ │ └── 8c2cd38c5fae9c349214f6835f5b4aaa622216 │ │ │ │ └── fe │ │ │ │ │ └── 5adb3985be3ef5e790eaf9b1b41f862d64dfc1 │ │ │ └── refs │ │ │ │ └── heads │ │ │ │ └── master │ │ ├── file1.ignored │ │ ├── file1.txt │ │ └── file2.txt │ │ ├── incoming │ │ ├── .gitignore │ │ ├── DOTgit │ │ │ ├── COMMIT_EDITMSG │ │ │ ├── HEAD │ │ │ ├── config │ │ │ ├── description │ │ │ ├── hooks │ │ │ │ ├── applypatch-msg.sample │ │ │ │ ├── commit-msg.sample │ │ │ │ ├── post-update.sample │ │ │ │ ├── pre-applypatch.sample │ │ │ │ ├── pre-commit.sample │ │ │ │ ├── pre-push.sample │ │ │ │ ├── pre-rebase.sample │ │ │ │ ├── prepare-commit-msg.sample │ │ │ │ └── update.sample │ │ │ ├── index │ │ │ ├── info │ │ │ │ ├── exclude │ │ │ │ └── refs │ │ │ ├── logs │ │ │ │ ├── HEAD │ │ │ │ └── refs │ │ │ │ │ └── heads │ │ │ │ │ └── master │ │ │ ├── objects │ │ │ │ ├── incoming_4632440628786417060.pack │ │ │ │ ├── incoming_4635689790689803605.pack │ │ │ │ ├── info │ │ │ │ │ └── packs │ │ │ │ └── pack │ │ │ │ │ ├── pack-71e0b18bc4675e30d48c891ae9bfc2487ec6e0bb.idx │ │ │ │ │ └── pack-71e0b18bc4675e30d48c891ae9bfc2487ec6e0bb.pack │ │ │ └── packed-refs │ │ ├── file1.txt │ │ └── file2.txt │ │ ├── repo │ │ ├── .gitignore │ │ ├── DOTgit │ │ │ ├── COMMIT_EDITMSG │ │ │ ├── HEAD │ │ │ ├── config │ │ │ ├── description │ │ │ ├── hooks │ │ │ │ ├── applypatch-msg.sample │ │ │ │ ├── commit-msg.sample │ │ │ │ ├── post-update.sample │ │ │ │ ├── pre-applypatch.sample │ │ │ │ ├── pre-commit.sample │ │ │ │ ├── pre-push.sample │ │ │ │ ├── pre-rebase.sample │ │ │ │ ├── prepare-commit-msg.sample │ │ │ │ └── update.sample │ │ │ ├── index │ │ │ ├── info │ │ │ │ └── exclude │ │ │ ├── logs │ │ │ │ ├── HEAD │ │ │ │ └── refs │ │ │ │ │ └── heads │ │ │ │ │ └── master │ │ │ ├── objects │ │ │ │ ├── 23 │ │ │ │ │ └── 462c896684e004db23cfab16255e176400643a │ │ │ │ ├── 39 │ │ │ │ │ └── 2f03252185fe21cb8926676deb84b60a617ff9 │ │ │ │ ├── 55 │ │ │ │ │ └── 45880406d44a71c1c179cb17a5819b59cbbc36 │ │ │ │ ├── 71 │ │ │ │ │ └── ebe5d70c8634f7531cc09c1cad5dae951a9052 │ │ │ │ ├── 4a │ │ │ │ │ └── 64431a59519ff25eff2cd94a561081146059b7 │ │ │ │ └── e6 │ │ │ │ │ └── 9de29bb2d1d6434b8b29ae775ad8c2e48c5391 │ │ │ └── refs │ │ │ │ └── heads │ │ │ │ └── master │ │ ├── file1.txt │ │ └── file2.txt │ │ └── without_incoming │ │ ├── .gitignore │ │ ├── DOTgit │ │ ├── COMMIT_EDITMSG │ │ ├── HEAD │ │ ├── config │ │ ├── description │ │ ├── hooks │ │ │ ├── applypatch-msg.sample │ │ │ ├── commit-msg.sample │ │ │ ├── post-update.sample │ │ │ ├── pre-applypatch.sample │ │ │ ├── pre-commit.sample │ │ │ ├── pre-push.sample │ │ │ ├── pre-rebase.sample │ │ │ ├── prepare-commit-msg.sample │ │ │ └── update.sample │ │ ├── index │ │ ├── info │ │ │ ├── exclude │ │ │ └── refs │ │ ├── logs │ │ │ ├── HEAD │ │ │ └── refs │ │ │ │ └── heads │ │ │ │ └── master │ │ ├── objects │ │ │ ├── info │ │ │ │ └── packs │ │ │ └── pack │ │ │ │ ├── pack-71e0b18bc4675e30d48c891ae9bfc2487ec6e0bb.idx │ │ │ │ └── pack-71e0b18bc4675e30d48c891ae9bfc2487ec6e0bb.pack │ │ └── packed-refs │ │ ├── file1.txt │ │ └── file2.txt │ ├── snapshot │ └── servermock │ │ └── util │ │ └── FileUtilTest │ │ ├── returnsFalseIfFileNamesAreNotEqual │ │ ├── neq1 │ │ │ ├── file.txt │ │ │ └── neq1.txt │ │ └── neq2 │ │ │ ├── file.txt │ │ │ └── neq2.txt │ │ ├── returnsFalseIfInnerDirectoryNamesAreNotEqual │ │ ├── neq1 │ │ │ └── neq1 │ │ │ │ └── file.txt │ │ └── neq2 │ │ │ └── neq2 │ │ │ └── file.txt │ │ ├── returnsFalseWhenFilesAreNotEqualInBothDirectories │ │ ├── neq1 │ │ │ └── file.txt │ │ └── neq2 │ │ │ └── file.txt │ │ ├── returnsFalseWhenRecursiveFilesAreNotEqualInBothDirectories │ │ ├── neq1 │ │ │ ├── dir │ │ │ │ └── file.txt │ │ │ └── file.txt │ │ └── neq2 │ │ │ ├── dir │ │ │ └── file.txt │ │ │ └── file.txt │ │ ├── returnsTrueEvenIfGitDirectoriesAreNotEqual │ │ ├── eq1 │ │ │ ├── dir │ │ │ │ └── file.txt │ │ │ └── file.txt │ │ └── eq2 │ │ │ ├── dir │ │ │ └── file.txt │ │ │ └── file.txt │ │ ├── returnsTrueWhenFilesAreEqualInBothDirectories │ │ ├── eq1 │ │ │ └── file.txt │ │ └── eq2 │ │ │ └── file.txt │ │ └── returnsTrueWhenRecursiveFilesAreEqualInBothDirectories │ │ ├── eq1 │ │ ├── dir │ │ │ └── file.txt │ │ └── file.txt │ │ └── eq2 │ │ ├── dir │ │ └── file.txt │ │ └── file.txt │ └── util │ └── TarTest │ ├── dir_with_empty_file │ └── empty │ └── testdir │ ├── file1 │ ├── file2 │ └── nest1 │ ├── file1 │ ├── file2 │ ├── file3 │ └── nest2 │ └── file1 ├── start.sh └── vendor └── envsubst /.dockerignore: -------------------------------------------------------------------------------- 1 | * 2 | !start.sh 3 | !/conf 4 | !/lib 5 | !/src/main 6 | !/pom.xml 7 | !/Makefile 8 | !/LICENSE 9 | !/vendor 10 | -------------------------------------------------------------------------------- /.github/dependabot.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | updates: 3 | - package-ecosystem: "maven" 4 | directory: "/" 5 | schedule: 6 | interval: "daily" 7 | 8 | pull-request-branch-name: 9 | # Separate sections of the branch name with a hyphen 10 | # Docker images use the branch name and do not support slashes in tags 11 | # https://github.com/overleaf/google-ops/issues/822 12 | # https://docs.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates#pull-request-branch-nameseparator 13 | separator: "-" 14 | 15 | # Block informal upgrades -- security upgrades use a separate queue. 16 | # https://docs.github.com/en/github/administering-a-repository/configuration-options-for-dependency-updates#open-pull-requests-limit 17 | open-pull-requests-limit: 0 18 | 19 | labels: 20 | - "dependencies" 21 | - "type:maintenance" 22 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm 2 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 3 | 4 | # Let's not share anything because we're using Maven. 5 | 6 | .idea 7 | *.iml 8 | 9 | # User-specific stuff: 10 | .idea/workspace.xml 11 | .idea/tasks.xml 12 | .idea/dictionaries 13 | .idea/vcs.xml 14 | .idea/jsLibraryMappings.xml 15 | 16 | # Sensitive or high-churn files: 17 | .idea/dataSources.ids 18 | .idea/dataSources.xml 19 | .idea/dataSources.local.xml 20 | .idea/sqlDataSources.xml 21 | .idea/dynamic.xml 22 | .idea/uiDesigner.xml 23 | 24 | # Gradle: 25 | .idea/gradle.xml 26 | .idea/libraries 27 | 28 | # Mongo Explorer plugin: 29 | .idea/mongoSettings.xml 30 | 31 | ## File-based project format: 32 | *.iws 33 | 34 | ## Plugin-specific files: 35 | 36 | # IntelliJ 37 | /out/ 38 | target/ 39 | 40 | # mpeltonen/sbt-idea plugin 41 | .idea_modules/ 42 | 43 | # JIRA plugin 44 | atlassian-ide-plugin.xml 45 | 46 | # Crashlytics plugin (for Android Studio and IntelliJ) 47 | com_crashlytics_export_strings.xml 48 | crashlytics.properties 49 | crashlytics-build.properties 50 | fabric.properties 51 | 52 | # Local configuration files 53 | conf/runtime.json 54 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2014 Winston Li 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # git-bridge makefile 2 | 3 | MVN_OPTS := "--no-transfer-progress" 4 | 5 | runtime-conf: 6 | /opt/envsubst < conf/envsubst_template.json > conf/runtime.json 7 | 8 | 9 | run: package runtime-conf 10 | java $(GIT_BRIDGE_JVM_ARGS) -jar \ 11 | target/writelatex-git-bridge-1.0-SNAPSHOT-jar-with-dependencies.jar \ 12 | conf/runtime.json 13 | 14 | 15 | build: 16 | mvn $(MVN_OPTS) package -DskipTests 17 | 18 | 19 | test: 20 | mvn $(MVN_OPTS) test 21 | 22 | 23 | clean: 24 | mvn $(MVN_OPTS) clean 25 | 26 | 27 | package: clean 28 | mvn $(MVN_OPTS) package -DskipTests 29 | 30 | 31 | .PHONY: run package build clean test runtime-conf 32 | -------------------------------------------------------------------------------- /conf/example_config.json: -------------------------------------------------------------------------------- 1 | { 2 | "port": 8080, 3 | "bindIp": "127.0.0.1", 4 | "idleTimeout": 30000, 5 | "rootGitDirectory": "/tmp/wlgb", 6 | "apiBaseUrl": "https://localhost/api/v0", 7 | "postbackBaseUrl": "https://localhost", 8 | "serviceName": "Overleaf", 9 | "oauth2": { 10 | "oauth2ClientID": "asdf", 11 | "oauth2ClientSecret": "asdf", 12 | "oauth2Server": "https://localhost" 13 | }, 14 | "repoStore": { 15 | "maxFileNum": 2000, 16 | "maxFileSize": 52428800 17 | }, 18 | "swapStore": { 19 | "type": "s3", 20 | "awsAccessKey": "asdf", 21 | "awsSecret": "asdf", 22 | "s3BucketName": "com.overleaf.testbucket", 23 | "awsRegion": "us-east-1" 24 | }, 25 | "swapJob": { 26 | "minProjects": 50, 27 | "lowGiB": 128, 28 | "highGiB": 256, 29 | "intervalMillis": 3600000, 30 | "compressionMethod": "gzip" 31 | }, 32 | "sqliteHeapLimitBytes": 512000000 33 | } 34 | -------------------------------------------------------------------------------- /conf/local.json: -------------------------------------------------------------------------------- 1 | { 2 | "port": 8000, 3 | "bindIp": "0.0.0.0", 4 | "idleTimeout": 30000, 5 | "rootGitDirectory": "/tmp/wlgb", 6 | "apiBaseUrl": "http://v2.overleaf.test:4000/api/v0", 7 | "postbackBaseUrl": "http://git-bridge:8000", 8 | "serviceName": "Overleaf", 9 | "oauth2": { 10 | "oauth2ClientID": "264c723c925c13590880751f861f13084934030c13b4452901e73bdfab226edc", 11 | "oauth2ClientSecret": "e6b2e9eee7ae2bb653823250bb69594a91db0547fe3790a7135acb497108e62d", 12 | "oauth2Server": "http://v2.overleaf.test:4000" 13 | }, 14 | "repoStore": { 15 | "maxFileNum": 2000, 16 | "maxFileSize": 52428800 17 | }, 18 | "swapStore": { 19 | "type": "noop" 20 | }, 21 | "swapJob": { 22 | "minProjects": 50, 23 | "lowGiB": 128, 24 | "highGiB": 256, 25 | "intervalMillis": 3600000, 26 | "compressionMethod": "gzip" 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /lib/newrelic.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/lib/newrelic.jar -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/application/config/Oauth2.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.application.config; 2 | 3 | /** 4 | * Created by winston on 25/10/15. 5 | */ 6 | public class Oauth2 { 7 | 8 | private final String oauth2ClientID; 9 | private final String oauth2ClientSecret; 10 | private final String oauth2Server; 11 | 12 | public Oauth2( 13 | String oauth2ClientID, 14 | String oauth2ClientSecret, 15 | String oauth2Server 16 | ) { 17 | this.oauth2ClientID = oauth2ClientID; 18 | this.oauth2ClientSecret = oauth2ClientSecret; 19 | this.oauth2Server = oauth2Server; 20 | } 21 | 22 | public String getOauth2ClientID() { 23 | return oauth2ClientID; 24 | } 25 | 26 | public String getOauth2ClientSecret() { 27 | return oauth2ClientSecret; 28 | } 29 | 30 | public String getOauth2Server() { 31 | return oauth2Server; 32 | } 33 | 34 | public static Oauth2 asSanitised(Oauth2 oauth2) { 35 | return new Oauth2( 36 | "", 37 | "", 38 | oauth2.oauth2Server 39 | ); 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/application/exception/ArgsException.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.application.exception; 2 | 3 | /** 4 | * Created by Winston on 03/11/14. 5 | */ 6 | public class ArgsException extends Exception {} 7 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/application/exception/ConfigFileException.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.application.exception; 2 | 3 | /** 4 | * Created by Winston on 05/12/14. 5 | */ 6 | public class ConfigFileException extends Exception { 7 | 8 | private final String missingMember; 9 | 10 | public ConfigFileException(String missingMember) { 11 | this.missingMember = missingMember; 12 | } 13 | 14 | public String getMissingMember() { 15 | return missingMember; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/bridge/db/DBInitException.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.bridge.db; 2 | 3 | /** 4 | * Created by winston on 23/08/2016. 5 | */ 6 | public class DBInitException extends RuntimeException { 7 | 8 | public DBInitException(String message) { 9 | super(message); 10 | } 11 | 12 | public DBInitException(String message, Throwable cause) { 13 | super(message, cause); 14 | } 15 | 16 | public DBInitException(Throwable cause) { 17 | super(cause); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/bridge/db/DBStore.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.bridge.db; 2 | 3 | import java.sql.Timestamp; 4 | import java.util.List; 5 | 6 | /** 7 | * Created by winston on 20/08/2016. 8 | */ 9 | public interface DBStore { 10 | 11 | int getNumProjects(); 12 | 13 | List getProjectNames(); 14 | 15 | void setLatestVersionForProject(String project, int versionID); 16 | 17 | int getLatestVersionForProject(String project); 18 | 19 | void addURLIndexForProject(String projectName, String url, String path); 20 | 21 | void deleteFilesForProject(String project, String... files); 22 | 23 | String getPathForURLInProject(String projectName, String url); 24 | 25 | String getOldestUnswappedProject(); 26 | 27 | void swap(String projectName, String compressionMethod); 28 | 29 | void restore(String projectName); 30 | 31 | String getSwapCompression(String projectName); 32 | 33 | int getNumUnswappedProjects(); 34 | 35 | ProjectState getProjectState(String projectName); 36 | 37 | /** 38 | * Sets the last accessed time for the given project name. 39 | * @param projectName the project's name 40 | * @param time the time, or null if the project is to be swapped 41 | */ 42 | void setLastAccessedTime(String projectName, Timestamp time); 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/bridge/db/ProjectState.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.bridge.db; 2 | 3 | /** 4 | * Created by winston on 24/08/2016. 5 | */ 6 | public enum ProjectState { 7 | 8 | NOT_PRESENT, 9 | PRESENT, 10 | SWAPPED 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/bridge/db/sqlite/SQLQuery.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.bridge.db.sqlite; 2 | 3 | import java.sql.ResultSet; 4 | import java.sql.SQLException; 5 | 6 | /** 7 | * Created by Winston on 20/11/14. 8 | */ 9 | public interface SQLQuery extends SQLUpdate { 10 | 11 | public T processResultSet(ResultSet resultSet) throws SQLException; 12 | 13 | } 14 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/bridge/db/sqlite/SQLUpdate.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.bridge.db.sqlite; 2 | 3 | import java.sql.PreparedStatement; 4 | import java.sql.SQLException; 5 | 6 | /** 7 | * Created by Winston on 20/11/14. 8 | */ 9 | public interface SQLUpdate { 10 | 11 | String getSQL(); 12 | default void addParametersToStatement( 13 | PreparedStatement statement 14 | ) throws SQLException { 15 | 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/bridge/db/sqlite/query/GetNumProjects.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.bridge.db.sqlite.query; 2 | 3 | import uk.ac.ic.wlgitbridge.bridge.db.sqlite.SQLQuery; 4 | 5 | import java.sql.ResultSet; 6 | import java.sql.SQLException; 7 | 8 | /** 9 | * Created by winston on 24/08/2016. 10 | */ 11 | public class GetNumProjects implements SQLQuery { 12 | 13 | private static final String GET_NUM_PROJECTS = 14 | "SELECT COUNT(*)\n" + 15 | " FROM `projects`"; 16 | 17 | @Override 18 | public String getSQL() { 19 | return GET_NUM_PROJECTS; 20 | } 21 | 22 | @Override 23 | public Integer processResultSet(ResultSet resultSet) throws SQLException { 24 | while (resultSet.next()) { 25 | return resultSet.getInt("COUNT(*)"); 26 | } 27 | throw new IllegalStateException("Count always returns results"); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/bridge/db/sqlite/query/GetNumUnswappedProjects.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.bridge.db.sqlite.query; 2 | 3 | import uk.ac.ic.wlgitbridge.bridge.db.sqlite.SQLQuery; 4 | 5 | import java.sql.ResultSet; 6 | import java.sql.SQLException; 7 | 8 | /** 9 | * Created by winston on 24/08/2016. 10 | */ 11 | public class GetNumUnswappedProjects implements SQLQuery { 12 | 13 | private static final String GET_NUM_UNSWAPPED_PROJECTS = 14 | "SELECT COUNT(*)\n" + 15 | " FROM `projects`\n" + 16 | " WHERE `last_accessed` IS NOT NULL"; 17 | 18 | @Override 19 | public String getSQL() { 20 | return GET_NUM_UNSWAPPED_PROJECTS; 21 | } 22 | 23 | @Override 24 | public Integer processResultSet(ResultSet resultSet) throws SQLException { 25 | while (resultSet.next()) { 26 | return resultSet.getInt("COUNT(*)"); 27 | } 28 | throw new IllegalStateException("Count always returns results"); 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/bridge/db/sqlite/query/GetOldestProjectName.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.bridge.db.sqlite.query; 2 | 3 | import uk.ac.ic.wlgitbridge.bridge.db.sqlite.SQLQuery; 4 | 5 | import java.sql.ResultSet; 6 | import java.sql.SQLException; 7 | 8 | /** 9 | * Created by winston on 23/08/2016. 10 | */ 11 | public class GetOldestProjectName implements SQLQuery { 12 | 13 | private static final String GET_OLDEST_PROJECT_NAME = 14 | "SELECT `name`, MIN(`last_accessed`)\n" + 15 | " FROM `projects` \n" + 16 | " WHERE `last_accessed` IS NOT NULL;"; 17 | 18 | @Override 19 | public String getSQL() { 20 | return GET_OLDEST_PROJECT_NAME; 21 | } 22 | 23 | @Override 24 | public String processResultSet(ResultSet resultSet) throws SQLException { 25 | while (resultSet.next()) { 26 | return resultSet.getString("name"); 27 | } 28 | return null; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/bridge/db/sqlite/query/GetProjectNamesSQLQuery.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.bridge.db.sqlite.query; 2 | 3 | import uk.ac.ic.wlgitbridge.bridge.db.sqlite.SQLQuery; 4 | 5 | import java.sql.ResultSet; 6 | import java.sql.SQLException; 7 | import java.util.ArrayList; 8 | import java.util.List; 9 | 10 | /** 11 | * Created by Winston on 21/02/15. 12 | */ 13 | public class GetProjectNamesSQLQuery implements SQLQuery> { 14 | 15 | private static final String GET_URL_INDEXES_FOR_PROJECT_NAME = 16 | "SELECT `name` FROM `projects`"; 17 | 18 | @Override 19 | public List processResultSet( 20 | ResultSet resultSet 21 | ) throws SQLException { 22 | List projectNames = new ArrayList<>(); 23 | while (resultSet.next()) { 24 | projectNames.add(resultSet.getString("name")); 25 | } 26 | return projectNames; 27 | } 28 | 29 | @Override 30 | public String getSQL() { 31 | return GET_URL_INDEXES_FOR_PROJECT_NAME; 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/bridge/db/sqlite/query/GetSwapCompression.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.bridge.db.sqlite.query; 2 | 3 | import uk.ac.ic.wlgitbridge.bridge.db.sqlite.SQLQuery; 4 | 5 | import java.sql.PreparedStatement; 6 | import java.sql.ResultSet; 7 | import java.sql.SQLException; 8 | 9 | public class GetSwapCompression implements SQLQuery { 10 | private static final String GET_SWAP_COMPRESSION = 11 | "SELECT `swap_compression` FROM `projects` WHERE `name` = ?"; 12 | 13 | private final String projectName; 14 | 15 | public GetSwapCompression(String projectName) { 16 | this.projectName = projectName; 17 | } 18 | 19 | @Override 20 | public String processResultSet(ResultSet resultSet) throws SQLException { 21 | String compression = null; 22 | while (resultSet.next()) { 23 | compression = resultSet.getString("swap_compression"); 24 | } 25 | return compression; 26 | } 27 | 28 | @Override 29 | public String getSQL() { 30 | return GET_SWAP_COMPRESSION; 31 | } 32 | 33 | @Override 34 | public void addParametersToStatement( 35 | PreparedStatement statement 36 | ) throws SQLException { 37 | statement.setString(1, projectName); 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/bridge/db/sqlite/query/LastAccessedColumnExists.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.bridge.db.sqlite.query; 2 | 3 | import uk.ac.ic.wlgitbridge.bridge.db.sqlite.SQLQuery; 4 | 5 | import java.sql.ResultSet; 6 | import java.sql.SQLException; 7 | 8 | /** 9 | * Created by winston on 04/09/2016. 10 | */ 11 | public class LastAccessedColumnExists implements SQLQuery { 12 | 13 | private static final String LAST_ACCESSED_COLUMN_EXISTS = 14 | "PRAGMA table_info(`projects`)"; 15 | 16 | @Override 17 | public String getSQL() { 18 | return LAST_ACCESSED_COLUMN_EXISTS; 19 | } 20 | 21 | @Override 22 | public Boolean processResultSet(ResultSet resultSet) throws SQLException { 23 | while (resultSet.next()) { 24 | if (resultSet.getString(2).equals("last_accessed")) { 25 | return true; 26 | } 27 | } 28 | return false; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/bridge/db/sqlite/query/RestoreTimeColumnExists.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.bridge.db.sqlite.query; 2 | 3 | import uk.ac.ic.wlgitbridge.bridge.db.sqlite.SQLQuery; 4 | 5 | import java.sql.ResultSet; 6 | import java.sql.SQLException; 7 | 8 | public class RestoreTimeColumnExists implements SQLQuery { 9 | private static final String RESTORE_TIME_COLUMN_EXISTS = 10 | "PRAGMA table_info(`projects`)"; 11 | 12 | @Override 13 | public String getSQL() { 14 | return RESTORE_TIME_COLUMN_EXISTS; 15 | } 16 | 17 | @Override 18 | public Boolean processResultSet(ResultSet resultSet) throws SQLException { 19 | while (resultSet.next()) { 20 | if (resultSet.getString(2).equals("restore_time")) { 21 | return true; 22 | } 23 | } 24 | return false; 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/bridge/db/sqlite/query/SwapCompressionColumnExists.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.bridge.db.sqlite.query; 2 | 3 | import uk.ac.ic.wlgitbridge.bridge.db.sqlite.SQLQuery; 4 | 5 | import java.sql.ResultSet; 6 | import java.sql.SQLException; 7 | 8 | public class SwapCompressionColumnExists implements SQLQuery { 9 | private static final String SWAP_COMPRESSION_COLUMN_EXISTS = 10 | "PRAGMA table_info(`projects`)"; 11 | 12 | @Override 13 | public String getSQL() { 14 | return SWAP_COMPRESSION_COLUMN_EXISTS; 15 | } 16 | 17 | @Override 18 | public Boolean processResultSet(ResultSet resultSet) throws SQLException { 19 | while (resultSet.next()) { 20 | if (resultSet.getString(2).equals("swap_compression")) { 21 | return true; 22 | } 23 | } 24 | return false; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/bridge/db/sqlite/query/SwapTimeColumnExists.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.bridge.db.sqlite.query; 2 | 3 | import uk.ac.ic.wlgitbridge.bridge.db.sqlite.SQLQuery; 4 | 5 | import java.sql.ResultSet; 6 | import java.sql.SQLException; 7 | 8 | public class SwapTimeColumnExists implements SQLQuery { 9 | private static final String SWAP_TIME_COLUMN_EXISTS = 10 | "PRAGMA table_info(`projects`)"; 11 | 12 | @Override 13 | public String getSQL() { 14 | return SWAP_TIME_COLUMN_EXISTS; 15 | } 16 | 17 | @Override 18 | public Boolean processResultSet(ResultSet resultSet) throws SQLException { 19 | while (resultSet.next()) { 20 | if (resultSet.getString(2).equals("swap_time")) { 21 | return true; 22 | } 23 | } 24 | return false; 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/bridge/db/sqlite/update/alter/ProjectsAddLastAccessed.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.bridge.db.sqlite.update.alter; 2 | 3 | import uk.ac.ic.wlgitbridge.bridge.db.sqlite.SQLUpdate; 4 | 5 | /** 6 | * Created by winston on 03/09/2016. 7 | */ 8 | public class ProjectsAddLastAccessed implements SQLUpdate { 9 | 10 | private static final String PROJECTS_ADD_LAST_ACCESSED = 11 | "ALTER TABLE `projects`\n" + 12 | "ADD COLUMN `last_accessed` DATETIME NULL DEFAULT 0"; 13 | 14 | @Override 15 | public String getSQL() { 16 | return PROJECTS_ADD_LAST_ACCESSED; 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/bridge/db/sqlite/update/alter/ProjectsAddRestoreTime.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.bridge.db.sqlite.update.alter; 2 | 3 | import uk.ac.ic.wlgitbridge.bridge.db.sqlite.SQLUpdate; 4 | 5 | public class ProjectsAddRestoreTime implements SQLUpdate { 6 | private static final String PROJECTS_ADD_RESTORE_TIME = 7 | "ALTER TABLE `projects`\n" + 8 | "ADD COLUMN `restore_time` DATETIME NULL;\n"; 9 | 10 | @Override 11 | public String getSQL() { 12 | return PROJECTS_ADD_RESTORE_TIME; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/bridge/db/sqlite/update/alter/ProjectsAddSwapCompression.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.bridge.db.sqlite.update.alter; 2 | 3 | import uk.ac.ic.wlgitbridge.bridge.db.sqlite.SQLUpdate; 4 | 5 | public class ProjectsAddSwapCompression implements SQLUpdate { 6 | private static final String PROJECTS_ADD_SWAP_COMPRESSION = 7 | "ALTER TABLE `projects`\n" + 8 | "ADD COLUMN `swap_compression` VARCHAR NULL;\n"; 9 | 10 | @Override 11 | public String getSQL() { 12 | return PROJECTS_ADD_SWAP_COMPRESSION; 13 | } 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/bridge/db/sqlite/update/alter/ProjectsAddSwapTime.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.bridge.db.sqlite.update.alter; 2 | 3 | import uk.ac.ic.wlgitbridge.bridge.db.sqlite.SQLUpdate; 4 | 5 | public class ProjectsAddSwapTime implements SQLUpdate { 6 | private static final String PROJECTS_ADD_SWAP_TIME = 7 | "ALTER TABLE `projects`\n" + 8 | "ADD COLUMN `swap_time` DATETIME NULL;\n"; 9 | 10 | @Override 11 | public String getSQL() { 12 | return PROJECTS_ADD_SWAP_TIME; 13 | } 14 | 15 | } 16 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/bridge/db/sqlite/update/alter/SetSoftHeapLimitPragma.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.bridge.db.sqlite.update.alter; 2 | 3 | import uk.ac.ic.wlgitbridge.bridge.db.sqlite.SQLUpdate; 4 | 5 | public class SetSoftHeapLimitPragma implements SQLUpdate { 6 | private int heapLimitBytes = 0; 7 | 8 | public SetSoftHeapLimitPragma(int heapLimitBytes) { 9 | this.heapLimitBytes = heapLimitBytes; 10 | } 11 | 12 | @Override 13 | public String getSQL() { 14 | return "PRAGMA soft_heap_limit="+this.heapLimitBytes+";"; 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/bridge/db/sqlite/update/create/CreateIndexURLIndexStore.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.bridge.db.sqlite.update.create; 2 | 3 | import uk.ac.ic.wlgitbridge.bridge.db.sqlite.SQLUpdate; 4 | 5 | /** 6 | * Created by Winston on 21/02/15. 7 | */ 8 | public class CreateIndexURLIndexStore implements SQLUpdate { 9 | 10 | public static final String CREATE_INDEX_URL_INDEX_STORE = 11 | "CREATE UNIQUE INDEX IF NOT EXISTS `project_path_index` " + 12 | "ON `url_index_store`(`project_name`, `path`);\n"; 13 | 14 | @Override 15 | public String getSQL() { 16 | return CREATE_INDEX_URL_INDEX_STORE; 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/bridge/db/sqlite/update/create/CreateProjectsIndexLastAccessed.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.bridge.db.sqlite.update.create; 2 | 3 | import uk.ac.ic.wlgitbridge.bridge.db.sqlite.SQLUpdate; 4 | 5 | /** 6 | * Created by winston on 23/08/2016. 7 | */ 8 | public class CreateProjectsIndexLastAccessed implements SQLUpdate { 9 | 10 | private static final String CREATE_PROJECTS_INDEX_LAST_ACCESSED = 11 | "CREATE INDEX IF NOT EXISTS `projects_index_last_accessed`\n" + 12 | " ON `projects`(`last_accessed`)"; 13 | 14 | @Override 15 | public String getSQL() { 16 | return CREATE_PROJECTS_INDEX_LAST_ACCESSED; 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/bridge/db/sqlite/update/create/CreateProjectsTableSQLUpdate.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.bridge.db.sqlite.update.create; 2 | 3 | import uk.ac.ic.wlgitbridge.bridge.db.sqlite.SQLUpdate; 4 | 5 | /** 6 | * Created by Winston on 20/11/14. 7 | */ 8 | public class CreateProjectsTableSQLUpdate implements SQLUpdate { 9 | 10 | private static final String CREATE_PROJECTS_TABLE = 11 | "CREATE TABLE IF NOT EXISTS `projects` (\n" + 12 | " `name` VARCHAR NOT NULL DEFAULT '',\n" + 13 | " `version_id` INT NOT NULL DEFAULT 0,\n" + 14 | " `last_accessed` DATETIME NULL DEFAULT 0,\n" + 15 | " `swap_time` DATETIME NULL,\n" + 16 | " `restore_time` DATETIME NULL,\n" + 17 | " `swap_compression` VARCHAR NULL,\n" + 18 | " PRIMARY KEY (`name`)\n" + 19 | ")"; 20 | 21 | @Override 22 | public String getSQL() { 23 | return CREATE_PROJECTS_TABLE; 24 | } 25 | 26 | } 27 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/bridge/db/sqlite/update/create/CreateURLIndexStoreSQLUpdate.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.bridge.db.sqlite.update.create; 2 | 3 | import uk.ac.ic.wlgitbridge.bridge.db.sqlite.SQLUpdate; 4 | 5 | /** 6 | * Created by Winston on 20/11/14. 7 | */ 8 | public class CreateURLIndexStoreSQLUpdate implements SQLUpdate { 9 | 10 | private static final String CREATE_URL_INDEX_STORE = 11 | "CREATE TABLE IF NOT EXISTS `url_index_store` (\n"+ 12 | " `project_name` varchar(10) NOT NULL DEFAULT '',\n"+ 13 | " `url` text NOT NULL,\n"+ 14 | " `path` text NOT NULL,\n"+ 15 | " PRIMARY KEY (`project_name`,`url`),\n"+ 16 | " CONSTRAINT `url_index_store_ibfk_1` " + 17 | "FOREIGN KEY (`project_name`) " + 18 | "REFERENCES `projects` (`name`) " + 19 | "ON DELETE CASCADE " + 20 | "ON UPDATE CASCADE\n"+ 21 | ");\n"; 22 | 23 | @Override 24 | public String getSQL() { 25 | return CREATE_URL_INDEX_STORE; 26 | } 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/bridge/db/sqlite/update/insert/SetProjectLastAccessedTime.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.bridge.db.sqlite.update.insert; 2 | 3 | import uk.ac.ic.wlgitbridge.bridge.db.sqlite.SQLUpdate; 4 | 5 | import java.sql.PreparedStatement; 6 | import java.sql.SQLException; 7 | import java.sql.Timestamp; 8 | 9 | /** 10 | * Created by winston on 23/08/2016. 11 | */ 12 | public class SetProjectLastAccessedTime implements SQLUpdate { 13 | 14 | private static final String SET_PROJECT_LAST_ACCESSED_TIME = 15 | "UPDATE `projects`\n" + 16 | "SET `last_accessed` = ?\n" + 17 | "WHERE `name` = ?"; 18 | 19 | private final String projectName; 20 | private final Timestamp lastAccessed; 21 | 22 | public SetProjectLastAccessedTime( 23 | String projectName, 24 | Timestamp lastAccessed 25 | ) { 26 | this.projectName = projectName; 27 | this.lastAccessed = lastAccessed; 28 | } 29 | 30 | @Override 31 | public String getSQL() { 32 | return SET_PROJECT_LAST_ACCESSED_TIME; 33 | } 34 | 35 | @Override 36 | public void addParametersToStatement( 37 | PreparedStatement statement 38 | ) throws SQLException { 39 | statement.setTimestamp(1, lastAccessed); 40 | statement.setString(2, projectName); 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/bridge/db/sqlite/update/insert/SetProjectSQLUpdate.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.bridge.db.sqlite.update.insert; 2 | 3 | import uk.ac.ic.wlgitbridge.bridge.db.sqlite.SQLUpdate; 4 | 5 | import java.sql.PreparedStatement; 6 | import java.sql.SQLException; 7 | 8 | /** 9 | * Created by Winston on 20/11/14. 10 | */ 11 | public class SetProjectSQLUpdate implements SQLUpdate { 12 | 13 | private static final String SET_PROJECT = 14 | "INSERT OR REPLACE " 15 | + "INTO `projects`(`name`, `version_id`, `last_accessed`) " 16 | + "VALUES (?, ?, DATETIME('now'));\n"; 17 | 18 | private final String projectName; 19 | private final int versionID; 20 | 21 | public SetProjectSQLUpdate(String projectName, int versionID) { 22 | this.projectName = projectName; 23 | this.versionID = versionID; 24 | } 25 | 26 | @Override 27 | public String getSQL() { 28 | return SET_PROJECT; 29 | } 30 | 31 | @Override 32 | public void addParametersToStatement( 33 | PreparedStatement statement 34 | ) throws SQLException { 35 | statement.setString(1, projectName); 36 | statement.setInt(2, versionID); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/bridge/db/sqlite/update/insert/UpdateRestore.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.bridge.db.sqlite.update.insert; 2 | 3 | import uk.ac.ic.wlgitbridge.bridge.db.sqlite.SQLUpdate; 4 | 5 | import java.sql.PreparedStatement; 6 | import java.sql.SQLException; 7 | import java.sql.Timestamp; 8 | import java.time.LocalDateTime; 9 | 10 | public class UpdateRestore implements SQLUpdate { 11 | private static final String UPDATE_RESTORE = 12 | "UPDATE `projects`\n" + 13 | "SET `last_accessed` = ?,\n" + 14 | " `swap_time` = NULL,\n" + 15 | " `restore_time` = ?,\n" + 16 | " `swap_compression` = NULL\n" + 17 | "WHERE `name` = ?;\n"; 18 | 19 | private final String projectName; 20 | private final Timestamp now; 21 | 22 | public UpdateRestore(String projectName) { 23 | this.projectName = projectName; 24 | this.now = Timestamp.valueOf(LocalDateTime.now()); 25 | } 26 | 27 | @Override 28 | public String getSQL() { 29 | return UPDATE_RESTORE; 30 | } 31 | 32 | @Override 33 | public void addParametersToStatement( 34 | PreparedStatement statement 35 | ) throws SQLException { 36 | statement.setTimestamp(1, now); 37 | statement.setTimestamp(2, now); 38 | statement.setString(3, projectName); 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/bridge/gc/GcJob.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.bridge.gc; 2 | 3 | import uk.ac.ic.wlgitbridge.bridge.Bridge; 4 | import uk.ac.ic.wlgitbridge.bridge.repo.ProjectRepo; 5 | import uk.ac.ic.wlgitbridge.data.filestore.RawDirectory; 6 | 7 | import java.util.Optional; 8 | import java.util.concurrent.CompletableFuture; 9 | 10 | /** 11 | * Is started by the bridge. Every time a project is updated, we queue it for 12 | * GC which executes every hour or so. 13 | * 14 | * We don't queue it into a more immediate Executor because there is no way to 15 | * know if a call to {@link Bridge#updateProject(Optional, ProjectRepo)}, 16 | * which releases the lock, is going to call 17 | * {@link Bridge#push(Optional, String, RawDirectory, RawDirectory, String)}. 18 | * 19 | * We don't want the GC to run in between an update and a push. 20 | */ 21 | public interface GcJob { 22 | 23 | void start(); 24 | 25 | void stop(); 26 | 27 | void onPreGc(Runnable preGc); 28 | 29 | void onPostGc(Runnable postGc); 30 | 31 | void queueForGc(String projectName); 32 | 33 | CompletableFuture waitForRun(); 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/bridge/lock/LockGuard.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.bridge.lock; 2 | 3 | /** 4 | * Created by winston on 24/08/2016. 5 | */ 6 | public interface LockGuard extends AutoCloseable { 7 | 8 | void close(); 9 | 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/bridge/lock/ProjectLock.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.bridge.lock; 2 | 3 | /** 4 | * Project Lock class. 5 | * 6 | * The locks should be re-entrant. For example, we are usually holding the lock 7 | * when a project must be restored, which tries to acquire the lock again. 8 | */ 9 | public interface ProjectLock { 10 | 11 | void lockAll(); 12 | 13 | void lockForProject(String projectName); 14 | 15 | void unlockForProject(String projectName); 16 | 17 | /* RAII hahaha */ 18 | default LockGuard lockGuard(String projectName) { 19 | lockForProject(projectName); 20 | return () -> unlockForProject(projectName); 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/bridge/repo/ProjectRepo.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.bridge.repo; 2 | 3 | import org.eclipse.jgit.lib.Repository; 4 | import uk.ac.ic.wlgitbridge.data.filestore.GitDirectoryContents; 5 | import uk.ac.ic.wlgitbridge.data.filestore.RawDirectory; 6 | import uk.ac.ic.wlgitbridge.git.exception.GitUserException; 7 | 8 | import java.io.File; 9 | import java.io.IOException; 10 | import java.util.Collection; 11 | 12 | /** 13 | * Created by winston on 20/08/2016. 14 | */ 15 | public interface ProjectRepo { 16 | 17 | String getProjectName(); 18 | 19 | void initRepo( 20 | RepoStore repoStore 21 | ) throws IOException; 22 | 23 | void useExistingRepository( 24 | RepoStore repoStore 25 | ) throws IOException; 26 | 27 | RawDirectory getDirectory( 28 | ) throws IOException, GitUserException; 29 | 30 | Collection commitAndGetMissing( 31 | GitDirectoryContents gitDirectoryContents 32 | ) throws IOException, GitUserException; 33 | 34 | void runGC() throws IOException; 35 | 36 | void deleteIncomingPacks() throws IOException; 37 | 38 | File getProjectDir(); 39 | 40 | Repository getJGitRepository(); 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/bridge/repo/RepoStoreConfig.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.bridge.repo; 2 | 3 | import javax.annotation.Nullable; 4 | import java.util.Optional; 5 | 6 | /** 7 | * Created by winston on 02/07/2017. 8 | */ 9 | public class RepoStoreConfig { 10 | 11 | @Nullable 12 | private final Long maxFileSize; 13 | 14 | @Nullable 15 | private final Long maxFileNum; 16 | 17 | public RepoStoreConfig(Long maxFileSize, Long maxFileNum) { 18 | this.maxFileSize = maxFileSize; 19 | this.maxFileNum = maxFileNum; 20 | } 21 | 22 | public Optional getMaxFileSize() { 23 | return Optional.ofNullable(maxFileSize); 24 | } 25 | 26 | public Optional getMaxFileNum() { 27 | return Optional.ofNullable(maxFileNum); 28 | } 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/bridge/resource/ResourceCache.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.bridge.resource; 2 | 3 | import uk.ac.ic.wlgitbridge.data.filestore.RawFile; 4 | import uk.ac.ic.wlgitbridge.git.exception.SizeLimitExceededException; 5 | 6 | import java.io.IOException; 7 | import java.util.Map; 8 | import java.util.Optional; 9 | 10 | /** 11 | * Created by winston on 20/08/2016. 12 | */ 13 | public interface ResourceCache { 14 | 15 | RawFile get( 16 | String projectName, 17 | String url, 18 | String newPath, 19 | Map fileTable, 20 | Map fetchedUrls, 21 | Optional maxFileSize 22 | ) throws IOException, SizeLimitExceededException; 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/bridge/swap/job/NoopSwapJob.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.bridge.swap.job; 2 | 3 | /** 4 | * Created by winston on 24/08/2016. 5 | */ 6 | public class NoopSwapJob implements SwapJob { 7 | 8 | @Override 9 | public void start() {} 10 | 11 | @Override 12 | public void stop() {} 13 | 14 | @Override 15 | public void evict(String projName) {} 16 | 17 | @Override 18 | public void restore(String projName) {} 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/bridge/swap/store/NoopSwapStore.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.bridge.swap.store; 2 | 3 | import java.io.ByteArrayInputStream; 4 | import java.io.InputStream; 5 | 6 | /** 7 | * Created by winston on 24/08/2016. 8 | */ 9 | public class NoopSwapStore implements SwapStore { 10 | 11 | public NoopSwapStore(SwapStoreConfig __) {} 12 | 13 | @Override 14 | public void upload( 15 | String projectName, 16 | InputStream uploadStream, 17 | long contentLength 18 | ) {} 19 | 20 | @Override 21 | public InputStream openDownloadStream(String projectName) { 22 | return new ByteArrayInputStream(new byte[0]); 23 | } 24 | 25 | @Override 26 | public void remove(String projectName) {} 27 | 28 | } 29 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/bridge/swap/store/SwapStore.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.bridge.swap.store; 2 | 3 | import java.io.IOException; 4 | import java.io.InputStream; 5 | import java.util.HashMap; 6 | import java.util.Map; 7 | import java.util.Optional; 8 | import java.util.function.Function; 9 | 10 | /** 11 | * Created by winston on 20/08/2016. 12 | */ 13 | public interface SwapStore { 14 | 15 | Map> swapStores = 16 | new HashMap>() { 17 | 18 | { 19 | put("noop", NoopSwapStore::new); 20 | put("memory", InMemorySwapStore::new); 21 | put("s3", S3SwapStore::new); 22 | } 23 | 24 | }; 25 | 26 | static SwapStore fromConfig( 27 | Optional cfg 28 | ) { 29 | SwapStoreConfig cfg_ = cfg.orElse(SwapStoreConfig.NOOP); 30 | String type = cfg_.getType(); 31 | return swapStores.get(type).apply(cfg_); 32 | } 33 | 34 | void upload( 35 | String projectName, 36 | InputStream uploadStream, 37 | long contentLength 38 | ) throws IOException; 39 | 40 | InputStream openDownloadStream(String projectName); 41 | 42 | void remove(String projectName); 43 | 44 | } 45 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/bridge/util/CastUtil.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.bridge.util; 2 | 3 | import com.google.common.base.Preconditions; 4 | 5 | /** 6 | * Created by winston on 01/07/2017. 7 | */ 8 | public class CastUtil { 9 | 10 | public static int assumeInt(long l) { 11 | Preconditions.checkArgument( 12 | l <= (long) Integer.MAX_VALUE 13 | && l >= (long) Integer.MIN_VALUE, 14 | l + " cannot fit inside an int"); 15 | return (int) l; 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/data/LockAllWaiter.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.data; 2 | 3 | /** 4 | * Created by Winston on 21/02/15. 5 | */ 6 | public interface LockAllWaiter { 7 | 8 | void threadsRemaining(int threads); 9 | 10 | } 11 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/data/ServletFile.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.data; 2 | 3 | import uk.ac.ic.wlgitbridge.data.filestore.RawFile; 4 | import java.util.UUID; 5 | 6 | /** 7 | * Created by Winston on 21/02/15. 8 | */ 9 | public class ServletFile extends RawFile { 10 | 11 | private final RawFile file; 12 | private final boolean changed; 13 | private String uuid; 14 | 15 | public ServletFile(RawFile file, RawFile oldFile) { 16 | this.file = file; 17 | this.uuid = UUID.randomUUID().toString(); 18 | changed = !equals(oldFile); 19 | } 20 | 21 | public String getUniqueIdentifier() { return uuid; } 22 | 23 | @Override 24 | public String getPath() { 25 | return file.getPath(); 26 | } 27 | 28 | @Override 29 | public byte[] getContents() { 30 | return file.getContents(); 31 | } 32 | 33 | @Override 34 | public long size() { 35 | return getContents().length; 36 | } 37 | 38 | public boolean isChanged() { 39 | return changed; 40 | } 41 | 42 | @Override 43 | public String toString() { 44 | return getPath(); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/data/filestore/RawDirectory.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.data.filestore; 2 | 3 | import uk.ac.ic.wlgitbridge.git.exception.SizeLimitExceededException; 4 | 5 | import java.util.Map; 6 | import java.util.Optional; 7 | 8 | /** 9 | * Created by Winston on 16/11/14. 10 | */ 11 | public class RawDirectory { 12 | 13 | private final Map fileTable; 14 | 15 | public RawDirectory(Map fileTable) { 16 | this.fileTable = fileTable; 17 | } 18 | 19 | public Map getFileTable() { 20 | return fileTable; 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/data/filestore/RepositoryFile.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.data.filestore; 2 | 3 | /** 4 | * Created by Winston on 16/11/14. 5 | */ 6 | public class RepositoryFile extends RawFile { 7 | 8 | private final String path; 9 | private final byte[] contents; 10 | 11 | public RepositoryFile(String path, byte[] contents) { 12 | this.path = path; 13 | this.contents = contents; 14 | } 15 | 16 | @Override 17 | public String getPath() { 18 | return path; 19 | } 20 | 21 | @Override 22 | public byte[] getContents() { 23 | return contents; 24 | } 25 | 26 | @Override 27 | public long size() { 28 | return contents.length; 29 | } 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/git/exception/FileLimitExceededException.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.git.exception; 2 | 3 | import uk.ac.ic.wlgitbridge.util.Util; 4 | 5 | import java.util.Arrays; 6 | import java.util.List; 7 | import java.util.Optional; 8 | 9 | public class FileLimitExceededException extends GitUserException { 10 | 11 | private final long numFiles; 12 | 13 | private final long maxFiles; 14 | 15 | public FileLimitExceededException(long numFiles, long maxFiles) { 16 | this.numFiles = numFiles; 17 | this.maxFiles = maxFiles; 18 | } 19 | 20 | @Override 21 | public String getMessage() { 22 | return "too many files"; 23 | } 24 | 25 | @Override 26 | public List getDescriptionLines() { 27 | return Arrays.asList( 28 | "repository contains " + 29 | numFiles + " files, which exceeds the limit of " + 30 | maxFiles + " files" 31 | ); 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/git/exception/GitUserException.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.git.exception; 2 | 3 | import java.util.List; 4 | 5 | /** 6 | * Created by winston on 20/08/2016. 7 | */ 8 | public abstract class GitUserException extends Exception { 9 | 10 | public abstract String getMessage(); 11 | 12 | public abstract List getDescriptionLines(); 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/git/exception/InvalidGitRepository.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.git.exception; 2 | 3 | import java.util.Arrays; 4 | import java.util.List; 5 | 6 | public class InvalidGitRepository extends GitUserException { 7 | 8 | @Override 9 | public String getMessage() { 10 | return "invalid git repo"; 11 | } 12 | 13 | @Override 14 | public List getDescriptionLines() { 15 | return Arrays.asList( 16 | "Your Git repository contains a reference we cannot resolve.", 17 | "If your project contains a Git submodule,", 18 | "please remove it and try again." 19 | ); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/git/exception/SizeLimitExceededException.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.git.exception; 2 | 3 | import uk.ac.ic.wlgitbridge.util.Util; 4 | 5 | import java.util.Arrays; 6 | import java.util.List; 7 | import java.util.Optional; 8 | 9 | public class SizeLimitExceededException extends GitUserException { 10 | 11 | private final Optional path; 12 | 13 | private final long actualSize; 14 | 15 | private final long maxSize; 16 | 17 | public SizeLimitExceededException( 18 | Optional path, long actualSize, long maxSize) { 19 | this.path = path; 20 | this.actualSize = actualSize; 21 | this.maxSize = maxSize; 22 | } 23 | 24 | @Override 25 | public String getMessage() { 26 | return "file too big"; 27 | } 28 | 29 | @Override 30 | public List getDescriptionLines() { 31 | String filename = 32 | path.isPresent() ? "File '" + path.get() + "' is" : "There's a file"; 33 | return Arrays.asList( 34 | filename + " too large to push to " 35 | + Util.getServiceName() + " via git", 36 | "the recommended maximum file size is 50 MiB" 37 | ); 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/git/exception/SnapshotAPIException.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.git.exception; 2 | 3 | import uk.ac.ic.wlgitbridge.snapshot.base.JSONSource; 4 | 5 | /** 6 | * Created by winston on 20/08/2016. 7 | */ 8 | public abstract class SnapshotAPIException 9 | extends GitUserException 10 | implements JSONSource {} 11 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/git/handler/hook/exception/ForcedPushException.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.git.handler.hook.exception; 2 | 3 | import com.google.gson.JsonElement; 4 | import uk.ac.ic.wlgitbridge.util.Util; 5 | import uk.ac.ic.wlgitbridge.snapshot.push.exception.SnapshotPostException; 6 | 7 | import java.util.Arrays; 8 | import java.util.List; 9 | 10 | /** 11 | * Created by Winston on 16/11/14. 12 | */ 13 | public class ForcedPushException extends SnapshotPostException { 14 | 15 | private static final String[] DESCRIPTION_LINES = { 16 | "You can't git push --force to a " 17 | + Util.getServiceName() 18 | + " project.", 19 | "Try to put your changes on top of the current head.", 20 | "If everything else fails, delete and reclone your repository, " 21 | + "make your changes, then push again." 22 | }; 23 | 24 | @Override 25 | public String getMessage() { 26 | return "forced push prohibited"; 27 | } 28 | 29 | @Override 30 | public List getDescriptionLines() { 31 | return Arrays.asList(DESCRIPTION_LINES); 32 | } 33 | 34 | @Override 35 | public void fromJSON(JsonElement json) {} 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/git/handler/hook/exception/WrongBranchException.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.git.handler.hook.exception; 2 | 3 | import com.google.gson.JsonElement; 4 | import uk.ac.ic.wlgitbridge.snapshot.push.exception.SnapshotPostException; 5 | 6 | import java.util.Arrays; 7 | import java.util.List; 8 | 9 | /** 10 | * Created by Winston on 19/12/14. 11 | */ 12 | public class WrongBranchException extends SnapshotPostException { 13 | 14 | private static final String[] DESCRIPTION_LINES = { 15 | "You can't push any new branches.", 16 | "Please use the master branch." 17 | }; 18 | 19 | @Override 20 | public String getMessage() { 21 | return "wrong branch"; 22 | } 23 | 24 | @Override 25 | public List getDescriptionLines() { 26 | return Arrays.asList(DESCRIPTION_LINES); 27 | } 28 | 29 | @Override 30 | public void fromJSON(JsonElement json) { 31 | 32 | } 33 | 34 | } 35 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/git/servlet/WLGitServletConfig.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.git.servlet; 2 | 3 | import org.eclipse.jetty.servlet.ServletContextHandler; 4 | 5 | import javax.servlet.ServletConfig; 6 | import javax.servlet.ServletContext; 7 | import java.util.Enumeration; 8 | 9 | /** 10 | * Created by Winston on 02/11/14. 11 | */ 12 | public class WLGitServletConfig implements ServletConfig { 13 | 14 | private static final String SERVLET_NAME = "git-servlet"; 15 | 16 | private ServletContext servletContext; 17 | 18 | public WLGitServletConfig(ServletContextHandler ctxHandler) { 19 | servletContext = ctxHandler.getServletContext(); 20 | } 21 | 22 | @Override 23 | public String getServletName() { 24 | return SERVLET_NAME; 25 | } 26 | 27 | @Override 28 | public ServletContext getServletContext() { 29 | return servletContext; 30 | } 31 | 32 | @Override 33 | public String getInitParameter(String s) { 34 | return null; 35 | } 36 | 37 | @Override 38 | public Enumeration getInitParameterNames() { 39 | return null; 40 | } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/io/http/ning/NingHttpClientFacade.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.io.http.ning; 2 | 3 | import io.netty.handler.codec.http.HttpHeaders; 4 | import uk.ac.ic.wlgitbridge.util.FunctionT; 5 | 6 | import java.util.concurrent.ExecutionException; 7 | 8 | public interface NingHttpClientFacade { 9 | 10 | /** 11 | * Performs a GET request 12 | * @param url the target URL 13 | * @param handler handler for the response headers. Returning false 14 | * aborts the request. 15 | * @return 16 | */ 17 | byte[] get( 18 | String url, 19 | FunctionT handler 20 | ) throws ExecutionException; 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/server/ProductionErrorHandler.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.server; 2 | 3 | import javax.servlet.http.HttpServletRequest; 4 | import javax.servlet.http.HttpServletResponse; 5 | import org.eclipse.jetty.server.handler.ErrorHandler; 6 | import java.io.IOException; 7 | 8 | public class ProductionErrorHandler extends ErrorHandler { 9 | @Override 10 | public void handle( 11 | String target, 12 | org.eclipse.jetty.server.Request baseRequest, 13 | HttpServletRequest request, 14 | HttpServletResponse response 15 | ) throws IOException { 16 | response.getWriter() 17 | .append("{\"message\":\"HTTP error ") 18 | .append(String.valueOf(response.getStatus())) 19 | .append("\"}"); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/snapshot/base/ForbiddenException.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.snapshot.base; 2 | 3 | import com.google.gson.JsonElement; 4 | import uk.ac.ic.wlgitbridge.git.exception.SnapshotAPIException; 5 | 6 | import java.util.Arrays; 7 | import java.util.List; 8 | 9 | /** 10 | * Created by winston on 25/10/15. 11 | */ 12 | public class ForbiddenException extends SnapshotAPIException { 13 | 14 | @Override 15 | public void fromJSON(JsonElement json) {} 16 | 17 | @Override 18 | public String getMessage() { 19 | return "forbidden"; 20 | } 21 | 22 | @Override 23 | public List getDescriptionLines() { 24 | return Arrays.asList(getMessage()); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/snapshot/base/HTTPMethod.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.snapshot.base; 2 | 3 | /** 4 | * Created by Winston on 16/11/14. 5 | */ 6 | public enum HTTPMethod { 7 | 8 | POST, 9 | GET 10 | 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/snapshot/base/JSONSource.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.snapshot.base; 2 | 3 | import com.google.gson.JsonElement; 4 | 5 | /** 6 | * Created by Winston on 06/11/14. 7 | */ 8 | public interface JSONSource { 9 | 10 | void fromJSON(JsonElement json); 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/snapshot/base/Result.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.snapshot.base; 2 | 3 | import com.google.gson.JsonElement; 4 | 5 | /** 6 | * Created by Winston on 06/11/14. 7 | */ 8 | public abstract class Result implements JSONSource { 9 | 10 | private JsonElement json; 11 | private Request request; 12 | 13 | public Result(Request request, JsonElement json) { 14 | this.request = request; 15 | this.json = json; 16 | fromJSON(json); 17 | } 18 | 19 | protected Result() { 20 | } 21 | 22 | public Request getRequest() { 23 | return request; 24 | } 25 | 26 | public abstract JsonElement toJson(); 27 | 28 | @Override 29 | public String toString() { 30 | if (json == null) { 31 | return "result"; 32 | } 33 | return json.toString(); 34 | } 35 | 36 | } 37 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/snapshot/base/SnapshotAPIRequest.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.snapshot.base; 2 | 3 | import com.google.api.client.auth.oauth2.Credential; 4 | import com.google.api.client.http.BasicAuthentication; 5 | import com.google.api.client.http.HttpRequest; 6 | 7 | import java.io.IOException; 8 | 9 | /** 10 | * Created by Winston on 06/11/14. 11 | */ 12 | public abstract class SnapshotAPIRequest extends Request { 13 | 14 | private static String BASE_URL; 15 | 16 | private final Credential oauth2; 17 | 18 | public SnapshotAPIRequest( 19 | String projectName, 20 | String apiCall, 21 | Credential oauth2 22 | ) { 23 | super(BASE_URL + projectName + apiCall); 24 | this.oauth2 = oauth2; 25 | } 26 | 27 | @Override 28 | protected void onBeforeRequest( 29 | HttpRequest request 30 | ) { 31 | if (oauth2 != null) { 32 | request.setInterceptor(request1 -> { 33 | oauth2.intercept(request1); 34 | }); 35 | } 36 | } 37 | 38 | /* baseURL ends with / */ 39 | public static void setBaseURL(String baseURL) { 40 | BASE_URL = baseURL + "docs/"; 41 | } 42 | 43 | } 44 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/snapshot/exception/FailedConnectionException.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.snapshot.exception; 2 | 3 | import org.eclipse.jgit.transport.ServiceMayNotContinueException; 4 | import uk.ac.ic.wlgitbridge.util.Util; 5 | 6 | /** 7 | * Created by Winston on 08/11/14. 8 | */ 9 | public class FailedConnectionException extends ServiceMayNotContinueException { 10 | 11 | public FailedConnectionException() { 12 | super(Util.getServiceName() + 13 | " server not available. Please try again later."); 14 | } 15 | 16 | public FailedConnectionException(Throwable cause) { 17 | super(cause); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/snapshot/getdoc/exception/InvalidProjectException.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.snapshot.getdoc.exception; 2 | 3 | import com.google.gson.JsonArray; 4 | import com.google.gson.JsonElement; 5 | import uk.ac.ic.wlgitbridge.git.exception.SnapshotAPIException; 6 | 7 | import java.util.LinkedList; 8 | import java.util.List; 9 | 10 | /** 11 | * Created by Winston on 08/11/14. 12 | */ 13 | public class InvalidProjectException extends SnapshotAPIException { 14 | 15 | private List errors; 16 | 17 | public InvalidProjectException() { 18 | super(); 19 | errors = new LinkedList(); 20 | } 21 | 22 | @Override 23 | public String getMessage() { 24 | return "invalid project"; 25 | } 26 | 27 | @Override 28 | public List getDescriptionLines() { 29 | return errors; 30 | } 31 | 32 | @Override 33 | public void fromJSON(JsonElement json) { 34 | errors = new LinkedList(); 35 | JsonArray errors = 36 | json.getAsJsonObject().get("errors").getAsJsonArray(); 37 | for (JsonElement error : errors) { 38 | this.errors.add(error.getAsString()); 39 | } 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/snapshot/getforversion/GetForVersionResult.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.snapshot.getforversion; 2 | 3 | import com.google.gson.JsonElement; 4 | import uk.ac.ic.wlgitbridge.snapshot.base.Request; 5 | import uk.ac.ic.wlgitbridge.snapshot.base.Result; 6 | import uk.ac.ic.wlgitbridge.util.Log; 7 | 8 | /** 9 | * Created by Winston on 06/11/14. 10 | */ 11 | public class GetForVersionResult extends Result { 12 | 13 | private SnapshotData snapshotData; 14 | 15 | public GetForVersionResult(Request request, JsonElement json) { 16 | super(request, json); 17 | } 18 | 19 | public GetForVersionResult(SnapshotData snapshotData) { 20 | this.snapshotData = snapshotData; 21 | } 22 | 23 | @Override 24 | public JsonElement toJson() { 25 | return snapshotData.toJson(); 26 | } 27 | 28 | @Override 29 | public void fromJSON(JsonElement json) { 30 | snapshotData = new SnapshotData(json); 31 | Log.info("GetForVersionResult({})", snapshotData); 32 | } 33 | 34 | public SnapshotData getSnapshotData() { 35 | return snapshotData; 36 | } 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/snapshot/getsavedvers/GetSavedVersRequest.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.snapshot.getsavedvers; 2 | 3 | import com.google.api.client.auth.oauth2.Credential; 4 | import com.google.gson.JsonElement; 5 | import uk.ac.ic.wlgitbridge.snapshot.base.SnapshotAPIRequest; 6 | import uk.ac.ic.wlgitbridge.snapshot.exception.FailedConnectionException; 7 | import uk.ac.ic.wlgitbridge.snapshot.base.HTTPMethod; 8 | import uk.ac.ic.wlgitbridge.util.Log; 9 | 10 | /** 11 | * Created by Winston on 06/11/14. 12 | */ 13 | public class GetSavedVersRequest 14 | extends SnapshotAPIRequest { 15 | 16 | public static final String API_CALL = "/saved_vers"; 17 | 18 | public GetSavedVersRequest(Credential oauth2, String projectName) { 19 | super(projectName, API_CALL, oauth2); 20 | Log.info( 21 | "GetSavedVersRequest({}, {})", 22 | "oauth2: ", 23 | "projectName: " + projectName 24 | ); 25 | } 26 | 27 | @Override 28 | protected HTTPMethod httpMethod() { 29 | return HTTPMethod.GET; 30 | } 31 | 32 | @Override 33 | protected GetSavedVersResult parseResponse( 34 | JsonElement json 35 | ) throws FailedConnectionException { 36 | return new GetSavedVersResult(this, json); 37 | } 38 | 39 | } 40 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/snapshot/getsavedvers/WLUser.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.snapshot.getsavedvers; 2 | 3 | import uk.ac.ic.wlgitbridge.util.Util; 4 | 5 | /** 6 | * Created by Winston on 06/11/14. 7 | */ 8 | public class WLUser { 9 | 10 | private final String name; 11 | private final String email; 12 | 13 | public WLUser() { 14 | this(null, null); 15 | } 16 | 17 | public WLUser(String name, String email) { 18 | if (name != null && email != null) { 19 | this.name = name; 20 | this.email = email; 21 | } else { 22 | this.name = "Anonymous"; 23 | this.email = "anonymous@" 24 | + Util.getServiceName().toLowerCase() 25 | + ".com"; 26 | } 27 | } 28 | 29 | public String getName() { 30 | return name; 31 | } 32 | 33 | public String getEmail() { 34 | return email; 35 | } 36 | 37 | @Override 38 | public String toString() { 39 | return "(" + name + ", " + email + ")"; 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/snapshot/push/exception/InternalErrorException.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.snapshot.push.exception; 2 | 3 | import com.google.gson.JsonElement; 4 | import uk.ac.ic.wlgitbridge.util.Util; 5 | 6 | import java.util.Arrays; 7 | import java.util.List; 8 | 9 | /** 10 | * Created by Winston on 09/01/15. 11 | */ 12 | public class InternalErrorException extends SevereSnapshotPostException { 13 | 14 | @Override 15 | public String getMessage() { 16 | return "internal error"; 17 | } 18 | 19 | @Override 20 | public List getDescriptionLines() { 21 | return Arrays.asList( 22 | "There was an internal error with the Git server.", 23 | "Please contact " + Util.getServiceName() + "." 24 | ); 25 | } 26 | 27 | @Override 28 | public void fromJSON(JsonElement json) {} 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/snapshot/push/exception/InvalidPostbackKeyException.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.snapshot.push.exception; 2 | 3 | /** 4 | * Created by Winston on 04/12/14. 5 | */ 6 | public class InvalidPostbackKeyException extends Exception {} 7 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/snapshot/push/exception/InvalidProjectException.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.snapshot.push.exception; 2 | 3 | import com.google.gson.JsonArray; 4 | import com.google.gson.JsonElement; 5 | 6 | import java.util.LinkedList; 7 | import java.util.List; 8 | 9 | /** 10 | * Created by Winston on 16/11/14. 11 | */ 12 | public class InvalidProjectException extends SnapshotPostException { 13 | 14 | private LinkedList descriptionLines; 15 | 16 | public InvalidProjectException(JsonElement jsonElement) { 17 | super(jsonElement); 18 | } 19 | 20 | @Override 21 | public String getMessage() { 22 | return "invalid project"; 23 | } 24 | 25 | @Override 26 | public List getDescriptionLines() { 27 | return descriptionLines; 28 | } 29 | 30 | @Override 31 | public void fromJSON(JsonElement json) { 32 | descriptionLines = new LinkedList(); 33 | JsonArray errors = 34 | json.getAsJsonObject().get("errors").getAsJsonArray(); 35 | for (JsonElement error : errors) { 36 | descriptionLines.add(error.getAsString()); 37 | } 38 | } 39 | 40 | } 41 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/snapshot/push/exception/OutOfDateException.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.snapshot.push.exception; 2 | 3 | import com.google.gson.JsonElement; 4 | import com.google.gson.JsonObject; 5 | 6 | import java.util.Arrays; 7 | import java.util.List; 8 | 9 | /** 10 | * Created by Winston on 16/11/14. 11 | */ 12 | public class OutOfDateException extends SnapshotPostException { 13 | 14 | public OutOfDateException(JsonObject json) { 15 | super(json); 16 | } 17 | 18 | public OutOfDateException() {} 19 | 20 | @Override 21 | public String getMessage() { 22 | return "out of date"; 23 | } 24 | 25 | @Override 26 | public List getDescriptionLines() { 27 | return Arrays.asList("out of date (shouldn't print this)"); 28 | } 29 | 30 | @Override 31 | public void fromJSON(JsonElement json) {} 32 | 33 | } 34 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/snapshot/push/exception/PostbackTimeoutException.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.snapshot.push.exception; 2 | 3 | import com.google.gson.JsonElement; 4 | import uk.ac.ic.wlgitbridge.util.Util; 5 | 6 | import java.util.Arrays; 7 | import java.util.List; 8 | 9 | /** 10 | * Created by Winston on 09/01/15. 11 | */ 12 | public class PostbackTimeoutException extends SevereSnapshotPostException { 13 | 14 | private int timeout; 15 | 16 | public PostbackTimeoutException(int timeout) { 17 | this.timeout = timeout; 18 | } 19 | 20 | @Override 21 | public String getMessage() { 22 | return "Request timed out (after " + this.timeout + " seconds)"; 23 | } 24 | 25 | @Override 26 | public List getDescriptionLines() { 27 | return Arrays.asList( 28 | "The " 29 | + Util.getServiceName() 30 | + " server is currently unavailable.", 31 | "Please try again later." 32 | ); 33 | } 34 | 35 | @Override 36 | public void fromJSON(JsonElement json) {} 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/snapshot/push/exception/SevereSnapshotPostException.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.snapshot.push.exception; 2 | 3 | import com.google.gson.JsonElement; 4 | 5 | /** 6 | * Created by Winston on 10/01/15. 7 | */ 8 | public abstract class SevereSnapshotPostException extends SnapshotPostException { 9 | 10 | public SevereSnapshotPostException() { 11 | super(); 12 | } 13 | 14 | public SevereSnapshotPostException(JsonElement json) { 15 | super(json); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/snapshot/push/exception/SnapshotPostException.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.snapshot.push.exception; 2 | 3 | import com.google.gson.JsonElement; 4 | import uk.ac.ic.wlgitbridge.git.exception.SnapshotAPIException; 5 | 6 | /** 7 | * Created by Winston on 16/11/14. 8 | */ 9 | public abstract class SnapshotPostException extends SnapshotAPIException { 10 | 11 | public SnapshotPostException() {} 12 | 13 | public SnapshotPostException(JsonElement jsonElement) { 14 | fromJSON(jsonElement); 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/snapshot/push/exception/SnapshotPostExceptionBuilder.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.snapshot.push.exception; 2 | 3 | import com.google.gson.JsonObject; 4 | 5 | /** 6 | * Created by Winston on 17/11/14. 7 | */ 8 | public class SnapshotPostExceptionBuilder { 9 | 10 | private static final String CODE_ERROR_OUT_OF_DATE = "outOfDate"; 11 | private static final String CODE_ERROR_INVALID_FILES = "invalidFiles"; 12 | private static final String CODE_ERROR_INVALID_PROJECT = "invalidProject"; 13 | private static final String CODE_ERROR_UNKNOWN = "error"; 14 | 15 | public SnapshotPostException build( 16 | String errorCode, 17 | JsonObject json 18 | ) throws UnexpectedPostbackException { 19 | if (errorCode.equals(CODE_ERROR_OUT_OF_DATE)) { 20 | return new OutOfDateException(json); 21 | } else if (errorCode.equals(CODE_ERROR_INVALID_FILES)) { 22 | return new InvalidFilesException(json); 23 | } else if (errorCode.equals(CODE_ERROR_INVALID_PROJECT)) { 24 | return new InvalidProjectException(json); 25 | } else if (errorCode.equals(CODE_ERROR_UNKNOWN)) { 26 | return new UnexpectedErrorException(json); 27 | } else { 28 | throw new UnexpectedPostbackException(); 29 | } 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/snapshot/push/exception/UnexpectedErrorException.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.snapshot.push.exception; 2 | 3 | import com.google.gson.JsonElement; 4 | import com.google.gson.JsonObject; 5 | import uk.ac.ic.wlgitbridge.util.Util; 6 | 7 | import java.util.Arrays; 8 | import java.util.List; 9 | 10 | /** 11 | * Created by Winston on 16/11/14. 12 | */ 13 | public class UnexpectedErrorException extends SevereSnapshotPostException { 14 | 15 | private static final String[] DESCRIPTION_LINES = { 16 | "There was an internal error with the " 17 | + Util.getServiceName() + " server.", 18 | "Please contact " + Util.getServiceName() + "." 19 | }; 20 | 21 | public UnexpectedErrorException(JsonObject json) { 22 | super(json); 23 | } 24 | 25 | @Override 26 | public String getMessage() { 27 | return Util.getServiceName() + " error"; 28 | } 29 | 30 | @Override 31 | public List getDescriptionLines() { 32 | return Arrays.asList(DESCRIPTION_LINES); 33 | } 34 | 35 | @Override 36 | public void fromJSON(JsonElement json) {} 37 | 38 | } 39 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/snapshot/push/exception/UnexpectedPostbackException.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.snapshot.push.exception; 2 | 3 | /** 4 | * Created by Winston on 17/11/14. 5 | */ 6 | public class UnexpectedPostbackException extends Exception {} 7 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/Main.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.snapshot.servermock; 2 | 3 | import uk.ac.ic.wlgitbridge.snapshot.servermock.server.MockSnapshotServer; 4 | import uk.ac.ic.wlgitbridge.snapshot.servermock.state.SnapshotAPIStateBuilder; 5 | 6 | import java.io.File; 7 | import java.io.FileInputStream; 8 | import java.io.FileNotFoundException; 9 | 10 | /** 11 | * Created by Winston on 10/01/15. 12 | */ 13 | public class Main { 14 | 15 | public static void main(String[] args) throws FileNotFoundException { 16 | MockSnapshotServer server = new MockSnapshotServer( 17 | 60000, 18 | new File("/Users/Roxy/Code/java/writelatex-git-bridge") 19 | ); 20 | server.setState( 21 | new SnapshotAPIStateBuilder( 22 | new FileInputStream( 23 | new File("/Users/Roxy/Desktop/state.json") 24 | ) 25 | ).build() 26 | ); 27 | server.start(); 28 | } 29 | 30 | } 31 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/exception/InvalidAPICallException.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.snapshot.servermock.exception; 2 | 3 | /** 4 | * Created by Winston on 09/01/15. 5 | */ 6 | public class InvalidAPICallException extends Exception { 7 | 8 | public InvalidAPICallException(String target) { 9 | super(target); 10 | } 11 | 12 | } 13 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/SnapshotResponse.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.snapshot.servermock.response; 2 | 3 | /** 4 | * Created by Winston on 09/01/15. 5 | */ 6 | public abstract class SnapshotResponse { 7 | 8 | public abstract String respond(); 9 | 10 | public String postback() { 11 | return null; 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/getdoc/SnapshotGetDocResponse.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.snapshot.servermock.response.getdoc; 2 | 3 | import uk.ac.ic.wlgitbridge.snapshot.servermock.response.SnapshotResponse; 4 | import uk.ac.ic.wlgitbridge.snapshot.getdoc.GetDocResult; 5 | 6 | /** 7 | * Created by Winston on 09/01/15. 8 | */ 9 | public class SnapshotGetDocResponse extends SnapshotResponse { 10 | 11 | private final GetDocResult state; 12 | 13 | public SnapshotGetDocResponse(GetDocResult state) { 14 | this.state = state; 15 | } 16 | 17 | @Override 18 | public String respond() { 19 | return state.toJson().toString(); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/getforver/SnapshotGetForVerResponse.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.snapshot.servermock.response.getforver; 2 | 3 | import uk.ac.ic.wlgitbridge.snapshot.servermock.response.SnapshotResponse; 4 | import uk.ac.ic.wlgitbridge.snapshot.getforversion.GetForVersionResult; 5 | 6 | /** 7 | * Created by Winston on 09/01/15. 8 | */ 9 | public class SnapshotGetForVerResponse extends SnapshotResponse { 10 | 11 | private final GetForVersionResult state; 12 | 13 | public SnapshotGetForVerResponse(GetForVersionResult state) { 14 | this.state = state; 15 | } 16 | 17 | @Override 18 | public String respond() { 19 | return state.toJson().toString(); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/getsavedver/SnapshotGetSavedVersResponse.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.snapshot.servermock.response.getsavedver; 2 | 3 | import uk.ac.ic.wlgitbridge.snapshot.servermock.response.SnapshotResponse; 4 | import uk.ac.ic.wlgitbridge.snapshot.getsavedvers.GetSavedVersResult; 5 | 6 | /** 7 | * Created by Winston on 09/01/15. 8 | */ 9 | public class SnapshotGetSavedVersResponse extends SnapshotResponse { 10 | 11 | private final GetSavedVersResult state; 12 | 13 | public SnapshotGetSavedVersResponse(GetSavedVersResult state) { 14 | this.state = state; 15 | } 16 | 17 | @Override 18 | public String respond() { 19 | return state.toJson().toString(); 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/push/SnapshotPushResponse.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.snapshot.servermock.response.push; 2 | 3 | import uk.ac.ic.wlgitbridge.snapshot.servermock.response.SnapshotResponse; 4 | import uk.ac.ic.wlgitbridge.snapshot.servermock.response.push.postback.SnapshotPostbackRequest; 5 | import uk.ac.ic.wlgitbridge.snapshot.servermock.response.push.data.SnapshotPushResult; 6 | 7 | /** 8 | * Created by Winston on 09/01/15. 9 | */ 10 | public class SnapshotPushResponse extends SnapshotResponse { 11 | 12 | private final SnapshotPushResult stateForPush; 13 | private final SnapshotPostbackRequest stateForPostback; 14 | 15 | public SnapshotPushResponse( 16 | SnapshotPushResult stateForPush, 17 | SnapshotPostbackRequest stateForPostback 18 | ) { 19 | this.stateForPush = stateForPush; 20 | this.stateForPostback = stateForPostback; 21 | } 22 | 23 | @Override 24 | public String respond() { 25 | return stateForPush.toJson().toString(); 26 | } 27 | 28 | @Override 29 | public String postback() { 30 | if (stateForPush.hasPostback()) { 31 | return stateForPostback.toJson().toString(); 32 | } else { 33 | return null; 34 | } 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/push/data/SnapshotPushResult.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.snapshot.servermock.response.push.data; 2 | 3 | import com.google.gson.JsonElement; 4 | import com.google.gson.JsonObject; 5 | 6 | /** 7 | * Created by Winston on 09/01/15. 8 | */ 9 | public abstract class SnapshotPushResult { 10 | 11 | private final int status; 12 | private final String code; 13 | private final String message; 14 | 15 | public SnapshotPushResult(int status, String code, String message) { 16 | this.status = status; 17 | this.code = code; 18 | this.message = message; 19 | } 20 | 21 | public JsonElement toJson() { 22 | JsonObject jsonThis = new JsonObject(); 23 | jsonThis.addProperty("status", status); 24 | jsonThis.addProperty("code", code); 25 | jsonThis.addProperty("message", message); 26 | return jsonThis; 27 | } 28 | 29 | public abstract boolean hasPostback(); 30 | 31 | } 32 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/push/data/SnapshotPushResultOutOfDate.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.snapshot.servermock.response.push.data; 2 | 3 | /** 4 | * Created by Winston on 09/01/15. 5 | */ 6 | public class SnapshotPushResultOutOfDate extends SnapshotPushResult { 7 | 8 | public SnapshotPushResultOutOfDate() { 9 | super(409, "outOfDate", "Out of Date"); 10 | } 11 | 12 | @Override 13 | public boolean hasPostback() { 14 | return false; 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/push/data/SnapshotPushResultSuccess.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.snapshot.servermock.response.push.data; 2 | 3 | /** 4 | * Created by Winston on 09/01/15. 5 | */ 6 | public class SnapshotPushResultSuccess extends SnapshotPushResult { 7 | 8 | public SnapshotPushResultSuccess() { 9 | super(402, "accepted", "Accepted"); 10 | } 11 | 12 | @Override 13 | public boolean hasPostback() { 14 | return true; 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/push/postback/SnapshotPostbackRequest.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.snapshot.servermock.response.push.postback; 2 | 3 | import com.google.gson.JsonObject; 4 | 5 | /** 6 | * Created by Winston on 09/01/15. 7 | */ 8 | public abstract class SnapshotPostbackRequest { 9 | 10 | private final String code; 11 | 12 | public SnapshotPostbackRequest(String code) { 13 | this.code = code; 14 | } 15 | 16 | public JsonObject toJson() { 17 | JsonObject jsonThis = new JsonObject(); 18 | jsonThis.addProperty("code", code); 19 | return jsonThis; 20 | } 21 | 22 | } 23 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/push/postback/SnapshotPostbackRequestError.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.snapshot.servermock.response.push.postback; 2 | 3 | import com.google.gson.JsonObject; 4 | 5 | /** 6 | * Created by Winston on 10/01/15. 7 | */ 8 | public class SnapshotPostbackRequestError extends SnapshotPostbackRequest { 9 | 10 | public SnapshotPostbackRequestError() { 11 | super("error"); 12 | } 13 | 14 | @Override 15 | public JsonObject toJson() { 16 | JsonObject jsonThis = super.toJson(); 17 | jsonThis.addProperty("message", "Unexpected Error"); 18 | return jsonThis; 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/push/postback/SnapshotPostbackRequestOutOfDate.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.snapshot.servermock.response.push.postback; 2 | 3 | import com.google.gson.JsonObject; 4 | 5 | /** 6 | * Created by Winston on 09/01/15. 7 | */ 8 | public class SnapshotPostbackRequestOutOfDate extends SnapshotPostbackRequest { 9 | 10 | public SnapshotPostbackRequestOutOfDate() { 11 | super("outOfDate"); 12 | } 13 | 14 | @Override 15 | public JsonObject toJson() { 16 | JsonObject jsonThis = super.toJson(); 17 | jsonThis.addProperty("message", "Out of Date"); 18 | return jsonThis; 19 | } 20 | 21 | } 22 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/push/postback/SnapshotPostbackRequestSuccess.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.snapshot.servermock.response.push.postback; 2 | 3 | import com.google.gson.JsonObject; 4 | 5 | /** 6 | * Created by Winston on 09/01/15. 7 | */ 8 | public class SnapshotPostbackRequestSuccess extends SnapshotPostbackRequest { 9 | 10 | private final int latestVerId; 11 | 12 | public SnapshotPostbackRequestSuccess(int latestVerId) { 13 | super("upToDate"); 14 | this.latestVerId = latestVerId; 15 | } 16 | 17 | @Override 18 | public JsonObject toJson() { 19 | JsonObject jsonThis = super.toJson(); 20 | jsonThis.addProperty("latestVerId", latestVerId); 21 | return jsonThis; 22 | } 23 | 24 | } 25 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/push/postback/invalidfile/InvalidFileErrorDefault.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.snapshot.servermock.response.push.postback.invalidfile; 2 | 3 | /** 4 | * Created by Winston on 09/01/15. 5 | */ 6 | public class InvalidFileErrorDefault extends InvalidFileError { 7 | 8 | public InvalidFileErrorDefault(String file) { 9 | super(file); 10 | } 11 | 12 | @Override 13 | protected String getState() { 14 | return "error"; 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/push/postback/invalidfile/InvalidFileErrorDisallowed.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.snapshot.servermock.response.push.postback.invalidfile; 2 | 3 | /** 4 | * Created by Winston on 09/01/15. 5 | */ 6 | public class InvalidFileErrorDisallowed extends InvalidFileError { 7 | 8 | public InvalidFileErrorDisallowed(String file) { 9 | super(file); 10 | } 11 | 12 | @Override 13 | protected String getState() { 14 | return "disallowed"; 15 | } 16 | 17 | } 18 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/snapshot/servermock/response/push/postback/invalidfile/InvalidFileErrorUnclean.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.snapshot.servermock.response.push.postback.invalidfile; 2 | 3 | import com.google.gson.JsonObject; 4 | 5 | /** 6 | * Created by Winston on 09/01/15. 7 | */ 8 | public class InvalidFileErrorUnclean extends InvalidFileError { 9 | 10 | private final String cleanFile; 11 | 12 | public InvalidFileErrorUnclean(String file, String cleanFile) { 13 | super(file); 14 | this.cleanFile = cleanFile; 15 | } 16 | 17 | @Override 18 | public JsonObject toJson() { 19 | JsonObject jsonThis = super.toJson(); 20 | jsonThis.addProperty("cleanFile", cleanFile); 21 | return jsonThis; 22 | } 23 | 24 | @Override 25 | protected String getState() { 26 | return "unclean_name"; 27 | } 28 | 29 | } 30 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/util/BiConsumerT.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.util; 2 | 3 | /** 4 | * BiConsumer interface that allows checked exceptions. 5 | */ 6 | @FunctionalInterface 7 | public interface BiConsumerT { 8 | 9 | void accept(T t, U u) throws E; 10 | 11 | } 12 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/util/FunctionT.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.util; 2 | 3 | /** 4 | * Function interface that allows checked exceptions. 5 | * @param 6 | * @param 7 | * @param 8 | */ 9 | @FunctionalInterface 10 | public interface FunctionT { 11 | 12 | R apply(T t) throws E; 13 | 14 | } 15 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/util/Instance.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.util; 2 | 3 | import com.google.api.client.http.HttpRequestFactory; 4 | import com.google.api.client.http.HttpTransport; 5 | import com.google.api.client.http.javanet.NetHttpTransport; 6 | import com.google.api.client.json.JsonFactory; 7 | import com.google.api.client.json.gson.GsonFactory; 8 | import com.google.gson.Gson; 9 | import com.google.gson.GsonBuilder; 10 | 11 | /** 12 | * Created by winston on 25/10/15. 13 | */ 14 | public class Instance { 15 | 16 | public static final HttpTransport httpTransport = 17 | new NetHttpTransport(); 18 | 19 | public static final HttpRequestFactory httpRequestFactory = 20 | httpTransport.createRequestFactory(); 21 | 22 | public static final JsonFactory jsonFactory = new GsonFactory(); 23 | 24 | public static final Gson prettyGson = new GsonBuilder() 25 | .setPrettyPrinting() 26 | .serializeNulls() 27 | .disableHtmlEscaping() 28 | .create(); 29 | 30 | public static final Gson gson = new Gson(); 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/util/Project.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.util; 2 | 3 | import com.google.common.base.Preconditions; 4 | 5 | /** 6 | * Created by winston on 23/08/2016. 7 | */ 8 | public class Project { 9 | 10 | public static boolean isValidProjectName(String projectName) { 11 | return projectName != null && !projectName.isEmpty() 12 | && !projectName.startsWith("."); 13 | } 14 | 15 | public static void checkValidProjectName(String projectName) { 16 | Preconditions.checkArgument(isValidProjectName(projectName), 17 | "[%s] invalid project name", projectName); 18 | } 19 | 20 | } 21 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/util/ResourceUtil.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.util; 2 | 3 | import org.apache.commons.io.FileUtils; 4 | 5 | import java.io.File; 6 | import java.io.IOException; 7 | 8 | public class ResourceUtil { 9 | 10 | /** 11 | * Creates a copy of a resource folder. Mainly used for testing to prevent 12 | * the original folder from being mangled. 13 | * 14 | * It will have the same name as the original. 15 | * @param resource the resource name, e.g. "/uk/ac/ic/wlgitbridge/file.txt" 16 | * @param folderProvider function used to create the folder. 17 | * E.g. TemporaryFolder from junit 18 | * @return 19 | * @throws IOException 20 | */ 21 | public static File copyOfFolderResource( 22 | String resource, 23 | FunctionT folderProvider 24 | ) throws IOException { 25 | File original 26 | = new File(ResourceUtil.class.getResource(resource).getFile()); 27 | File tmp = folderProvider.apply(original.getName()); 28 | FileUtils.copyDirectory(original, tmp); 29 | return tmp; 30 | } 31 | 32 | } 33 | -------------------------------------------------------------------------------- /src/main/java/uk/ac/ic/wlgitbridge/util/TimerUtils.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.util; 2 | 3 | import java.util.TimerTask; 4 | 5 | /** 6 | * Created by winston on 23/08/2016. 7 | */ 8 | public class TimerUtils { 9 | 10 | public static TimerTask makeTimerTask(Runnable lamb) { 11 | return new TimerTask() { 12 | @Override 13 | public void run() { 14 | try { 15 | lamb.run(); 16 | } catch (Throwable t) { 17 | Log.warn("Error on timer", t); 18 | } 19 | } 20 | }; 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /src/test/java/uk/ac/ic/wlgitbridge/bridge/db/sqlite/update/delete/DeleteFilesForProjectSQLUpdateTest.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.bridge.db.sqlite.update.delete; 2 | 3 | import org.junit.Test; 4 | import static org.junit.Assert.*; 5 | 6 | public class DeleteFilesForProjectSQLUpdateTest { 7 | 8 | @Test 9 | public void testGetSQL() { 10 | DeleteFilesForProjectSQLUpdate update = 11 | new DeleteFilesForProjectSQLUpdate( 12 | "projname", 13 | "path1", 14 | "path2" 15 | ); 16 | assertEquals( 17 | "DELETE FROM `url_index_store` " + 18 | "WHERE `project_name` = ? " + 19 | "AND path IN (?, ?);\n", 20 | update.getSQL() 21 | ); 22 | } 23 | 24 | } -------------------------------------------------------------------------------- /src/test/java/uk/ac/ic/wlgitbridge/bridge/swap/store/S3SwapStoreTest.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.bridge.swap.store; 2 | 3 | import org.junit.Before; 4 | 5 | /** 6 | * Created by winston on 21/08/2016. 7 | */ 8 | public class S3SwapStoreTest { 9 | 10 | private static final String accessKey = null; 11 | private static final String secret = null; 12 | private static final String bucketName = "com.overleaf.testbucket"; 13 | private static final String region = "us-east-1"; 14 | 15 | private S3SwapStore s3; 16 | 17 | @Before 18 | public void setup() { 19 | if (accessKey == null || secret == null) { 20 | s3 = null; 21 | return; 22 | } 23 | s3 = new S3SwapStore(accessKey, secret, bucketName, region); 24 | } 25 | 26 | // @Ignore 27 | // @Test 28 | // public void testUploadDownloadDelete() throws Exception { 29 | // assumeNotNull(s3); 30 | // String projName = "abc123"; 31 | // byte[] contents = "hello".getBytes(); 32 | // s3.upload( 33 | // projName, 34 | // new ByteArrayInputStream(contents), 35 | // contents.length 36 | // ); 37 | // InputStream down = s3.openDownloadStream(projName); 38 | // s3.remove(projName); 39 | // assertArrayEquals(contents, IOUtils.toByteArray(down)); 40 | // } 41 | 42 | } 43 | -------------------------------------------------------------------------------- /src/test/java/uk/ac/ic/wlgitbridge/util/ProjectTest.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.util; 2 | 3 | import org.junit.Assert; 4 | import org.junit.Test; 5 | 6 | /** 7 | * Created by winston on 23/08/2016. 8 | */ 9 | public class ProjectTest { 10 | 11 | @Test 12 | public void testValidProjectNames() { 13 | Assert.assertFalse(Project.isValidProjectName(null)); 14 | Assert.assertFalse(Project.isValidProjectName("")); 15 | Assert.assertFalse(Project.isValidProjectName(".wlgb")); 16 | } 17 | 18 | } 19 | -------------------------------------------------------------------------------- /src/test/java/uk/ac/ic/wlgitbridge/util/TimerUtilsTest.java: -------------------------------------------------------------------------------- 1 | package uk.ac.ic.wlgitbridge.util; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.assertEquals; 6 | 7 | /** 8 | * Created by winston on 23/08/2016. 9 | */ 10 | public class TimerUtilsTest { 11 | 12 | @Test 13 | public void testMakeTimerTask() { 14 | int[] iPtr = new int[] { 3 }; 15 | TimerUtils.makeTimerTask(() -> iPtr[0] = 5).run(); 16 | assertEquals(5, iPtr[0]); 17 | } 18 | 19 | } 20 | -------------------------------------------------------------------------------- /src/test/resources/logback-test.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | System.err 5 | 6 | %d{yyyy-MM-dd HH:mm:ss.SSS} %-5level [%thread] %logger{0}: %msg%n 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canCloneAMigratedRepositoryWithoutChanges/state/state.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "project": "testproj_no_change", 4 | "getDoc": { 5 | "versionID": 0, 6 | "createdAt": "2014-11-30T18:40:58.123Z", 7 | "email": "jdleesmiller+1@gmail.com", 8 | "name": "John+1" 9 | }, 10 | "getSavedVers": [], 11 | "getForVers": [ 12 | { 13 | "versionID": 0, 14 | "srcs": [ 15 | { 16 | "content": "test content\n", 17 | "path": "main.tex" 18 | } 19 | ], 20 | "atts": [] 21 | } 22 | ], 23 | "push": "success", 24 | "postback": { 25 | "type": "success", 26 | "versionID": 1 27 | } 28 | } 29 | ] 30 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canCloneAMigratedRepositoryWithoutChanges/state/testproj_no_change/main.tex: -------------------------------------------------------------------------------- 1 | test content 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canCloneARepository/state/testproj/foo/bar/test.tex: -------------------------------------------------------------------------------- 1 | This text is from another file. -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canCloneARepository/state/testproj/main.tex: -------------------------------------------------------------------------------- 1 | content 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canCloneARepository/state/testproj/min_mean_wait_evm_7_eps_150dpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canCloneARepository/state/testproj/min_mean_wait_evm_7_eps_150dpi.png -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canCloneDuplicateBinaryFiles/state/testproj/main.tex: -------------------------------------------------------------------------------- 1 | content 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canCloneDuplicateBinaryFiles/state/testproj/overleaf-white-410-copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canCloneDuplicateBinaryFiles/state/testproj/overleaf-white-410-copy.png -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canCloneDuplicateBinaryFiles/state/testproj/overleaf-white-410.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canCloneDuplicateBinaryFiles/state/testproj/overleaf-white-410.png -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canCloneDuplicateBinaryFiles/state/testproj/test.tex: -------------------------------------------------------------------------------- 1 | This text is from another file. -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canCloneMultipleRepositories/state/testproj1/foo/bar/test.tex: -------------------------------------------------------------------------------- 1 | This text is from another file. -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canCloneMultipleRepositories/state/testproj1/main.tex: -------------------------------------------------------------------------------- 1 | content 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canCloneMultipleRepositories/state/testproj1/overleaf-white-410.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canCloneMultipleRepositories/state/testproj1/overleaf-white-410.png -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canCloneMultipleRepositories/state/testproj2/editor-versions-a7e4de19d015c3e7477e3f7eaa6c418e.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canCloneMultipleRepositories/state/testproj2/editor-versions-a7e4de19d015c3e7477e3f7eaa6c418e.png -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canCloneMultipleRepositories/state/testproj2/foo/bar/test.tex: -------------------------------------------------------------------------------- 1 | a different one -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canCloneMultipleRepositories/state/testproj2/main.tex: -------------------------------------------------------------------------------- 1 | different content 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canMigrateRepository/state/testproj/foo/bar/test.tex: -------------------------------------------------------------------------------- 1 | This text is from another file. -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canMigrateRepository/state/testproj/main.tex: -------------------------------------------------------------------------------- 1 | content 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canMigrateRepository/state/testproj/min_mean_wait_evm_7_eps_150dpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canMigrateRepository/state/testproj/min_mean_wait_evm_7_eps_150dpi.png -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullADeletedBinaryFile/base/state.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "project": "testproj", 4 | "getDoc": { 5 | "versionID": 1, 6 | "createdAt": "2014-11-30T18:40:58.123Z", 7 | "email": "jdleesmiller+1@gmail.com", 8 | "name": "John+1" 9 | }, 10 | "getSavedVers": [ 11 | { 12 | "versionID": 1, 13 | "comment": "added more info on doc GET and error details", 14 | "email": "jdleesmiller+1@gmail.com", 15 | "name": "John+1", 16 | "createdAt": "2014-11-30T18:47:01.456Z" 17 | } 18 | ], 19 | "getForVers": [ 20 | { 21 | "versionID": 1, 22 | "srcs": [ 23 | { 24 | "content": "content\n", 25 | "path": "main.tex" 26 | }, 27 | { 28 | "content": "This text is from another file.", 29 | "path": "test.tex" 30 | } 31 | ], 32 | "atts": [ 33 | { 34 | "url": "http://127.0.0.1:3863/base/testproj/overleaf-white-410.png", 35 | "path": "overleaf-white-410.png" 36 | } 37 | ] 38 | } 39 | ], 40 | "push": "success", 41 | "postback": { 42 | "type": "success", 43 | "versionID": 2 44 | } 45 | } 46 | ] -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullADeletedBinaryFile/base/testproj/main.tex: -------------------------------------------------------------------------------- 1 | content 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullADeletedBinaryFile/base/testproj/overleaf-white-410.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullADeletedBinaryFile/base/testproj/overleaf-white-410.png -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullADeletedBinaryFile/base/testproj/test.tex: -------------------------------------------------------------------------------- 1 | This text is from another file. -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullADeletedBinaryFile/withDeletedBinaryFile/testproj/main.tex: -------------------------------------------------------------------------------- 1 | content 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullADeletedBinaryFile/withDeletedBinaryFile/testproj/test.tex: -------------------------------------------------------------------------------- 1 | This text is from another file. -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullADeletedTexFile/base/state.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "project": "testproj", 4 | "getDoc": { 5 | "versionID": 1, 6 | "createdAt": "2014-11-30T18:40:58.123Z", 7 | "email": "jdleesmiller+1@gmail.com", 8 | "name": "John+1" 9 | }, 10 | "getSavedVers": [ 11 | { 12 | "versionID": 1, 13 | "comment": "added more info on doc GET and error details", 14 | "email": "jdleesmiller+1@gmail.com", 15 | "name": "John+1", 16 | "createdAt": "2014-11-30T18:47:01.456Z" 17 | } 18 | ], 19 | "getForVers": [ 20 | { 21 | "versionID": 1, 22 | "srcs": [ 23 | { 24 | "content": "content\n", 25 | "path": "main.tex" 26 | }, 27 | { 28 | "content": "This text is from another file.", 29 | "path": "test.tex" 30 | } 31 | ], 32 | "atts": [ 33 | { 34 | "url": "http://127.0.0.1:3860/base/testproj/overleaf-white-410.png", 35 | "path": "overleaf-white-410.png" 36 | } 37 | ] 38 | } 39 | ], 40 | "push": "success", 41 | "postback": { 42 | "type": "success", 43 | "versionID": 2 44 | } 45 | } 46 | ] -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullADeletedTexFile/base/testproj/main.tex: -------------------------------------------------------------------------------- 1 | content 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullADeletedTexFile/base/testproj/overleaf-white-410.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullADeletedTexFile/base/testproj/overleaf-white-410.png -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullADeletedTexFile/base/testproj/test.tex: -------------------------------------------------------------------------------- 1 | This text is from another file. -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullADeletedTexFile/withDeletedTexFile/testproj/main.tex: -------------------------------------------------------------------------------- 1 | content 2 | added more stuff 3 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullADeletedTexFile/withDeletedTexFile/testproj/overleaf-white-410.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullADeletedTexFile/withDeletedTexFile/testproj/overleaf-white-410.png -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullADuplicateBinaryFile/base/state.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "project": "testproj", 4 | "getDoc": { 5 | "versionID": 1, 6 | "createdAt": "2014-11-30T18:40:58.123Z", 7 | "email": "jdleesmiller+1@gmail.com", 8 | "name": "John+1" 9 | }, 10 | "getSavedVers": [ 11 | { 12 | "versionID": 1, 13 | "comment": "added more info on doc GET and error details", 14 | "email": "jdleesmiller+1@gmail.com", 15 | "name": "John+1", 16 | "createdAt": "2014-11-30T18:47:01.456Z" 17 | } 18 | ], 19 | "getForVers": [ 20 | { 21 | "versionID": 1, 22 | "srcs": [ 23 | { 24 | "content": "content\n", 25 | "path": "main.tex" 26 | }, 27 | { 28 | "content": "This text is from another file.", 29 | "path": "test.tex" 30 | } 31 | ], 32 | "atts": [ 33 | { 34 | "url": "http://127.0.0.1:4001/base/testproj/overleaf-white-410.png", 35 | "path": "overleaf-white-410.png" 36 | } 37 | ] 38 | } 39 | ], 40 | "push": "success", 41 | "postback": { 42 | "type": "success", 43 | "versionID": 2 44 | } 45 | } 46 | ] -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullADuplicateBinaryFile/base/testproj/main.tex: -------------------------------------------------------------------------------- 1 | content 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullADuplicateBinaryFile/base/testproj/overleaf-white-410.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullADuplicateBinaryFile/base/testproj/overleaf-white-410.png -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullADuplicateBinaryFile/base/testproj/test.tex: -------------------------------------------------------------------------------- 1 | This text is from another file. -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullADuplicateBinaryFile/withDuplicateBinaryFile/testproj/main.tex: -------------------------------------------------------------------------------- 1 | content 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullADuplicateBinaryFile/withDuplicateBinaryFile/testproj/overleaf-white-410-copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullADuplicateBinaryFile/withDuplicateBinaryFile/testproj/overleaf-white-410-copy.png -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullADuplicateBinaryFile/withDuplicateBinaryFile/testproj/overleaf-white-410.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullADuplicateBinaryFile/withDuplicateBinaryFile/testproj/overleaf-white-410.png -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullADuplicateBinaryFile/withDuplicateBinaryFile/testproj/test.tex: -------------------------------------------------------------------------------- 1 | This text is from another file. -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullAModifiedBinaryFile/base/state.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "project": "testproj", 4 | "getDoc": { 5 | "versionID": 1, 6 | "createdAt": "2014-11-30T18:40:58.123Z", 7 | "email": "jdleesmiller+1@gmail.com", 8 | "name": "John+1" 9 | }, 10 | "getSavedVers": [ 11 | { 12 | "versionID": 1, 13 | "comment": "added more info on doc GET and error details", 14 | "email": "jdleesmiller+1@gmail.com", 15 | "name": "John+1", 16 | "createdAt": "2014-11-30T18:47:01.456Z" 17 | } 18 | ], 19 | "getForVers": [ 20 | { 21 | "versionID": 1, 22 | "srcs": [ 23 | { 24 | "content": "content\n", 25 | "path": "main.tex" 26 | }, 27 | { 28 | "content": "This text is from another file.", 29 | "path": "test.tex" 30 | } 31 | ], 32 | "atts": [ 33 | { 34 | "url": "http://127.0.0.1:3862/base/testproj/overleaf-white-410.png", 35 | "path": "overleaf-white-410.png" 36 | } 37 | ] 38 | } 39 | ], 40 | "push": "success", 41 | "postback": { 42 | "type": "success", 43 | "versionID": 2 44 | } 45 | } 46 | ] -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullAModifiedBinaryFile/base/testproj/main.tex: -------------------------------------------------------------------------------- 1 | content 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullAModifiedBinaryFile/base/testproj/overleaf-white-410.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullAModifiedBinaryFile/base/testproj/overleaf-white-410.png -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullAModifiedBinaryFile/base/testproj/test.tex: -------------------------------------------------------------------------------- 1 | This text is from another file. -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullAModifiedBinaryFile/withModifiedBinaryFile/testproj/main.tex: -------------------------------------------------------------------------------- 1 | content 2 | added more stuff 3 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullAModifiedBinaryFile/withModifiedBinaryFile/testproj/overleaf-white-410.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullAModifiedBinaryFile/withModifiedBinaryFile/testproj/overleaf-white-410.png -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullAModifiedBinaryFile/withModifiedBinaryFile/testproj/test.tex: -------------------------------------------------------------------------------- 1 | This text is from another file. -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullAModifiedNestedFile/base/testproj/main.tex: -------------------------------------------------------------------------------- 1 | content 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullAModifiedNestedFile/base/testproj/overleaf-white-410.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullAModifiedNestedFile/base/testproj/overleaf-white-410.png -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullAModifiedNestedFile/base/testproj/test.tex: -------------------------------------------------------------------------------- 1 | This text is from another file. -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullAModifiedNestedFile/withModifiedNestedFile/testproj/main.tex: -------------------------------------------------------------------------------- 1 | content 2 | added more stuff 3 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullAModifiedNestedFile/withModifiedNestedFile/testproj/nest1/nest1.tex: -------------------------------------------------------------------------------- 1 | nest1 -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullAModifiedNestedFile/withModifiedNestedFile/testproj/nest1/nest2/nest2.tex: -------------------------------------------------------------------------------- 1 | nest2 -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullAModifiedNestedFile/withModifiedNestedFile/testproj/overleaf-white-410.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullAModifiedNestedFile/withModifiedNestedFile/testproj/overleaf-white-410.png -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullAModifiedNestedFile/withModifiedNestedFile/testproj/test.tex: -------------------------------------------------------------------------------- 1 | This text is from another file. -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullAModifiedTexFile/base/state.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "project": "testproj", 4 | "getDoc": { 5 | "versionID": 1, 6 | "createdAt": "2014-11-30T18:40:58.123Z", 7 | "email": "jdleesmiller+1@gmail.com", 8 | "name": "John+1" 9 | }, 10 | "getSavedVers": [ 11 | { 12 | "versionID": 1, 13 | "comment": "added more info on doc GET and error details", 14 | "email": "jdleesmiller+1@gmail.com", 15 | "name": "John+1", 16 | "createdAt": "2014-11-30T18:47:01.456Z" 17 | } 18 | ], 19 | "getForVers": [ 20 | { 21 | "versionID": 1, 22 | "srcs": [ 23 | { 24 | "content": "content\n", 25 | "path": "main.tex" 26 | }, 27 | { 28 | "content": "This text is from another file.", 29 | "path": "test.tex" 30 | } 31 | ], 32 | "atts": [ 33 | { 34 | "url": "http://127.0.0.1:3859/base/testproj/overleaf-white-410.png", 35 | "path": "overleaf-white-410.png" 36 | } 37 | ] 38 | } 39 | ], 40 | "push": "success", 41 | "postback": { 42 | "type": "success", 43 | "versionID": 2 44 | } 45 | } 46 | ] -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullAModifiedTexFile/base/testproj/main.tex: -------------------------------------------------------------------------------- 1 | content 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullAModifiedTexFile/base/testproj/overleaf-white-410.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullAModifiedTexFile/base/testproj/overleaf-white-410.png -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullAModifiedTexFile/base/testproj/test.tex: -------------------------------------------------------------------------------- 1 | This text is from another file. -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullAModifiedTexFile/withModifiedTexFile/testproj/main.tex: -------------------------------------------------------------------------------- 1 | content 2 | added more stuff 3 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullAModifiedTexFile/withModifiedTexFile/testproj/overleaf-white-410.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullAModifiedTexFile/withModifiedTexFile/testproj/overleaf-white-410.png -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullAModifiedTexFile/withModifiedTexFile/testproj/test.tex: -------------------------------------------------------------------------------- 1 | This text is from another file. and modified -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullDeletedNestedFiles/base/testproj/main.tex: -------------------------------------------------------------------------------- 1 | content 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullDeletedNestedFiles/base/testproj/nest1/nest1.tex: -------------------------------------------------------------------------------- 1 | nest1 -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullDeletedNestedFiles/base/testproj/nest1/nest2/nest2.tex: -------------------------------------------------------------------------------- 1 | nest2 -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullDeletedNestedFiles/base/testproj/overleaf-white-410.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullDeletedNestedFiles/base/testproj/overleaf-white-410.png -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullDeletedNestedFiles/base/testproj/test.tex: -------------------------------------------------------------------------------- 1 | This text is from another file. -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullDeletedNestedFiles/withDeletedNestedFiles/testproj/main.tex: -------------------------------------------------------------------------------- 1 | content 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullDeletedNestedFiles/withDeletedNestedFiles/testproj/overleaf-white-410.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullDeletedNestedFiles/withDeletedNestedFiles/testproj/overleaf-white-410.png -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullDeletedNestedFiles/withDeletedNestedFiles/testproj/test.tex: -------------------------------------------------------------------------------- 1 | This text is from another file. -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullIgnoredForceAddedFile/base/state.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "project": "testproj", 4 | "getDoc": { 5 | "versionID": 1, 6 | "createdAt": "2014-11-30T18:40:58.123Z", 7 | "email": "jdleesmiller+1@gmail.com", 8 | "name": "John+1" 9 | }, 10 | "getSavedVers": [ 11 | { 12 | "versionID": 1, 13 | "comment": "init", 14 | "email": "jdleesmiller+1@gmail.com", 15 | "name": "John+1", 16 | "createdAt": "2014-11-30T18:47:01.456Z" 17 | } 18 | ], 19 | "getForVers": [ 20 | { 21 | "versionID": 1, 22 | "srcs": [ 23 | { 24 | "content": "content\n", 25 | "path": "main.tex" 26 | }, 27 | { 28 | "content": "*.txt", 29 | "path": "sub/.gitignore" 30 | } 31 | ], 32 | "atts": [] 33 | } 34 | ], 35 | "push": "success", 36 | "postback": { 37 | "type": "success", 38 | "versionID": 2 39 | } 40 | } 41 | ] 42 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullIgnoredForceAddedFile/base/testproj/main.tex: -------------------------------------------------------------------------------- 1 | content 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullIgnoredForceAddedFile/base/testproj/sub/.gitignore: -------------------------------------------------------------------------------- 1 | *.txt 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullIgnoredForceAddedFile/withUpdatedMainFile/state.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "project": "testproj", 4 | "getDoc": { 5 | "versionID": 5, 6 | "createdAt": "2014-11-30T18:40:58.123Z", 7 | "email": "jdleesmiller+1@gmail.com", 8 | "name": "John+1" 9 | }, 10 | "getSavedVers": [ 11 | { 12 | "versionID": 5, 13 | "comment": "init", 14 | "email": "jdleesmiller+1@gmail.com", 15 | "name": "John+1", 16 | "createdAt": "2014-11-30T18:47:01.456Z" 17 | } 18 | ], 19 | "getForVers": [ 20 | { 21 | "versionID": 5, 22 | "srcs": [ 23 | { 24 | "content": "content\nupdated\n", 25 | "path": "main.tex" 26 | }, 27 | { 28 | "content": "*.txt", 29 | "path": "sub/.gitignore" 30 | }, 31 | { 32 | "content": "1", 33 | "path": "sub/one.txt" 34 | } 35 | ], 36 | "atts": [] 37 | } 38 | ], 39 | "push": "success", 40 | "postback": { 41 | "type": "success", 42 | "versionID": 5 43 | } 44 | } 45 | ] 46 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullIgnoredForceAddedFile/withUpdatedMainFile/testproj/main.tex: -------------------------------------------------------------------------------- 1 | content 2 | updated 3 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullIgnoredForceAddedFile/withUpdatedMainFile/testproj/sub/.gitignore: -------------------------------------------------------------------------------- 1 | *.txt 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullIgnoredForceAddedFile/withUpdatedMainFile/testproj/sub/one.txt: -------------------------------------------------------------------------------- 1 | 1 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullUpdatedBinaryFiles/base/testproj/main.tex: -------------------------------------------------------------------------------- 1 | content 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullUpdatedBinaryFiles/base/testproj/overleaf-white-410-copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullUpdatedBinaryFiles/base/testproj/overleaf-white-410-copy.png -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullUpdatedBinaryFiles/base/testproj/overleaf-white-410.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullUpdatedBinaryFiles/base/testproj/overleaf-white-410.png -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullUpdatedBinaryFiles/base/testproj/test.tex: -------------------------------------------------------------------------------- 1 | This text is from another file. -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullUpdatedBinaryFiles/withUpdatedBinaryFiles/testproj/main.tex: -------------------------------------------------------------------------------- 1 | content 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullUpdatedBinaryFiles/withUpdatedBinaryFiles/testproj/overleaf-white-410-copy.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullUpdatedBinaryFiles/withUpdatedBinaryFiles/testproj/overleaf-white-410-copy.png -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullUpdatedBinaryFiles/withUpdatedBinaryFiles/testproj/overleaf-white-410.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullUpdatedBinaryFiles/withUpdatedBinaryFiles/testproj/overleaf-white-410.png -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPullUpdatedBinaryFiles/withUpdatedBinaryFiles/testproj/test.tex: -------------------------------------------------------------------------------- 1 | This text is from another file. -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPushFilesSuccessfully/state/testproj/foo/bar/test.tex: -------------------------------------------------------------------------------- 1 | This text is from another file. -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPushFilesSuccessfully/state/testproj/main.tex: -------------------------------------------------------------------------------- 1 | content 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPushFilesSuccessfully/state/testproj/min_mean_wait_evm_7_eps_150dpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canPushFilesSuccessfully/state/testproj/min_mean_wait_evm_7_eps_150dpi.png -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canServePushedFiles/state/state.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "project": "testproj", 4 | "getDoc": { 5 | "versionID": 1, 6 | "createdAt": "2014-11-30T18:40:58.123Z", 7 | "email": "test1@example.com", 8 | "name": "John+1" 9 | }, 10 | "getSavedVers": [], 11 | "getForVers": [ 12 | { 13 | "versionID": 1, 14 | "srcs": [ 15 | { 16 | "content": "content\n", 17 | "path": "main.tex" 18 | } 19 | ], 20 | "atts": [] 21 | } 22 | ], 23 | "push": "success", 24 | "postback": { 25 | "type": "success", 26 | "versionID": 1 27 | } 28 | } 29 | ] 30 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/canServePushedFiles/state/testproj/main.tex: -------------------------------------------------------------------------------- 1 | content 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/cannotCloneA4xxProject/state/state.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "project": "gone", 4 | "getDoc": { 5 | "error": 410, 6 | "versionID": 1, 7 | "createdAt": "2018-02-05T15:30:00Z", 8 | "email": "michael.walker@overleaf.com", 9 | "name": "msw" 10 | }, 11 | "getSavedVers": [], 12 | "getForVers": [], 13 | "push": "success", 14 | "postback": { 15 | "type": "outOfDate" 16 | } 17 | } 18 | ] 19 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/cannotCloneAHasDotGitProject/state/state.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "project": "conflict", 4 | "getDoc": { 5 | "error": 409, 6 | "code": "projectHasDotGit", 7 | "versionID": 1, 8 | "createdAt": "2018-02-05T15:30:00Z", 9 | "email": "michael.walker@overleaf.com", 10 | "name": "msw" 11 | }, 12 | "getSavedVers": [], 13 | "getForVers": [], 14 | "push": "success", 15 | "postback": { 16 | "type": "outOfDate" 17 | } 18 | } 19 | ] 20 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/cannotCloneAMissingProject/state/state.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "project": "missing", 4 | "getDoc": { 5 | "error": 404, 6 | "versionID": 1, 7 | "createdAt": "2018-02-06T13:29:00Z", 8 | "email": "michael.walker@overleaf.com", 9 | "name": "msw" 10 | }, 11 | "getSavedVers": [], 12 | "getForVers": [], 13 | "push": "success", 14 | "postback": { 15 | "type": "outOfDate" 16 | } 17 | } 18 | ] 19 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/pushFailsOnFirstStageOutOfDate/state/testproj/foo/bar/test.tex: -------------------------------------------------------------------------------- 1 | This text is from another file. -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/pushFailsOnFirstStageOutOfDate/state/testproj/main.tex: -------------------------------------------------------------------------------- 1 | content 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/pushFailsOnFirstStageOutOfDate/state/testproj/min_mean_wait_evm_7_eps_150dpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/pushFailsOnFirstStageOutOfDate/state/testproj/min_mean_wait_evm_7_eps_150dpi.png -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/pushFailsOnInvalidFiles/state/testproj/foo/bar/test.tex: -------------------------------------------------------------------------------- 1 | This text is from another file. -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/pushFailsOnInvalidFiles/state/testproj/main.tex: -------------------------------------------------------------------------------- 1 | content 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/pushFailsOnInvalidFiles/state/testproj/min_mean_wait_evm_7_eps_150dpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/pushFailsOnInvalidFiles/state/testproj/min_mean_wait_evm_7_eps_150dpi.png -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/pushFailsOnInvalidProject/state/testproj/foo/bar/test.tex: -------------------------------------------------------------------------------- 1 | This text is from another file. -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/pushFailsOnInvalidProject/state/testproj/main.tex: -------------------------------------------------------------------------------- 1 | content 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/pushFailsOnInvalidProject/state/testproj/min_mean_wait_evm_7_eps_150dpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/pushFailsOnInvalidProject/state/testproj/min_mean_wait_evm_7_eps_150dpi.png -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/pushFailsOnSecondStageOutOfDate/state/testproj/foo/bar/test.tex: -------------------------------------------------------------------------------- 1 | This text is from another file. -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/pushFailsOnSecondStageOutOfDate/state/testproj/main.tex: -------------------------------------------------------------------------------- 1 | content 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/pushFailsOnSecondStageOutOfDate/state/testproj/min_mean_wait_evm_7_eps_150dpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/pushFailsOnSecondStageOutOfDate/state/testproj/min_mean_wait_evm_7_eps_150dpi.png -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/pushFailsOnUnexpectedError/state/testproj/foo/bar/test.tex: -------------------------------------------------------------------------------- 1 | This text is from another file. -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/pushFailsOnUnexpectedError/state/testproj/main.tex: -------------------------------------------------------------------------------- 1 | content 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/pushFailsOnUnexpectedError/state/testproj/min_mean_wait_evm_7_eps_150dpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/pushFailsOnUnexpectedError/state/testproj/min_mean_wait_evm_7_eps_150dpi.png -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/pushSubmoduleFailsWithInvalidGitRepo/state/testproj/foo/bar/test.tex: -------------------------------------------------------------------------------- 1 | This text is from another file. -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/pushSubmoduleFailsWithInvalidGitRepo/state/testproj/main.tex: -------------------------------------------------------------------------------- 1 | content 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/pushSubmoduleFailsWithInvalidGitRepo/state/testproj/min_mean_wait_evm_7_eps_150dpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/pushSubmoduleFailsWithInvalidGitRepo/state/testproj/min_mean_wait_evm_7_eps_150dpi.png -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/pushSucceedsAfterRemovingInvalidFiles/invalidState/state.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "project": "testproj", 4 | "getDoc": { 5 | "versionID": 1, 6 | "createdAt": "2014-11-30T18:40:58.123Z", 7 | "email": "test@example.com", 8 | "name": "Test User" 9 | }, 10 | "getSavedVers": [], 11 | "getForVers": [ 12 | { 13 | "versionID": 1, 14 | "srcs": [ 15 | { 16 | "content": "content\n", 17 | "path": "main.tex" 18 | } 19 | ], 20 | "atts": [] 21 | } 22 | ], 23 | "push": "success", 24 | "postback": { 25 | "type": "invalidFiles", 26 | "errors": [ 27 | { 28 | "file": "file1.exe", 29 | "state": "disallowed" 30 | } 31 | ] 32 | } 33 | } 34 | ] -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/pushSucceedsAfterRemovingInvalidFiles/invalidState/testproj/main.tex: -------------------------------------------------------------------------------- 1 | content 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/pushSucceedsAfterRemovingInvalidFiles/validState/state.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "project": "testproj", 4 | "getDoc": { 5 | "versionID": 1, 6 | "createdAt": "2014-11-30T18:40:58.123Z", 7 | "email": "test@example.com", 8 | "name": "Test User" 9 | }, 10 | "getSavedVers": [], 11 | "getForVers": [ 12 | { 13 | "versionID": 1, 14 | "srcs": [ 15 | { 16 | "content": "content\n", 17 | "path": "main.tex" 18 | } 19 | ], 20 | "atts": [] 21 | } 22 | ], 23 | "push": "success", 24 | "postback": { 25 | "type": "success", 26 | "versionID": 2 27 | } 28 | } 29 | ] -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/pushSucceedsAfterRemovingInvalidFiles/validState/testproj/main.tex: -------------------------------------------------------------------------------- 1 | content 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/rejectV1Repository/state/1234bbccddff/foo/bar/test.tex: -------------------------------------------------------------------------------- 1 | This text is from another file. -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/rejectV1Repository/state/1234bbccddff/main.tex: -------------------------------------------------------------------------------- 1 | content 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/rejectV1Repository/state/1234bbccddff/min_mean_wait_evm_7_eps_150dpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/rejectV1Repository/state/1234bbccddff/min_mean_wait_evm_7_eps_150dpi.png -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/skipMigrationWhenMigratedFromMissing/state/state.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "project": "testproj2", 4 | "getDoc": { 5 | "versionID": 1, 6 | "createdAt": "2014-11-30T18:40:58.123Z", 7 | "email": "jdleesmiller+1@gmail.com", 8 | "name": "John+1", 9 | "migratedFromId": "testprojthatdoesnotexist" 10 | }, 11 | "getSavedVers": [], 12 | "getForVers": [ 13 | { 14 | "versionID": 1, 15 | "srcs": [ 16 | { 17 | "content": "two\n", 18 | "path": "main.tex" 19 | }, 20 | { 21 | "content": "This text is from another file.", 22 | "path": "foo/bar/test.tex" 23 | } 24 | ], 25 | "atts": [ 26 | { 27 | "url": "http://127.0.0.1:3882/state/testproj2/min_mean_wait_evm_7_eps_150dpi.png", 28 | "path": "min_mean_wait_evm_7_eps_150dpi.png" 29 | } 30 | ] 31 | } 32 | ], 33 | "push": "success", 34 | "postback": { 35 | "type": "success", 36 | "versionID": 2 37 | } 38 | } 39 | ] 40 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/skipMigrationWhenMigratedFromMissing/state/testproj2/foo/bar/test.tex: -------------------------------------------------------------------------------- 1 | This text is from another file. -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/skipMigrationWhenMigratedFromMissing/state/testproj2/main.tex: -------------------------------------------------------------------------------- 1 | two 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/skipMigrationWhenMigratedFromMissing/state/testproj2/min_mean_wait_evm_7_eps_150dpi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/skipMigrationWhenMigratedFromMissing/state/testproj2/min_mean_wait_evm_7_eps_150dpi.png -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/wlgbCanSwapProjects/state/testproj1/foo/bar/test.tex: -------------------------------------------------------------------------------- 1 | This text is from another file. -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/wlgbCanSwapProjects/state/testproj1/main.tex: -------------------------------------------------------------------------------- 1 | content 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/wlgbCanSwapProjects/state/testproj1/overleaf-white-410.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/wlgbCanSwapProjects/state/testproj1/overleaf-white-410.png -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/wlgbCanSwapProjects/state/testproj2/editor-versions-a7e4de19d015c3e7477e3f7eaa6c418e.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/wlgbCanSwapProjects/state/testproj2/editor-versions-a7e4de19d015c3e7477e3f7eaa6c418e.png -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/wlgbCanSwapProjects/state/testproj2/foo/bar/test.tex: -------------------------------------------------------------------------------- 1 | a different one -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/WLGitBridgeIntegrationTest/wlgbCanSwapProjects/state/testproj2/main.tex: -------------------------------------------------------------------------------- 1 | different content 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/FSGitRepoStoreTest/rootdir/.wlgb/wlgb.db: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/FSGitRepoStoreTest/rootdir/.wlgb/wlgb.db -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/FSGitRepoStoreTest/rootdir/idontexist/idontexist.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/FSGitRepoStoreTest/rootdir/idontexist/idontexist.txt -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/FSGitRepoStoreTest/rootdir/proj1/DOTgit/COMMIT_EDITMSG: -------------------------------------------------------------------------------- 1 | Main 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/FSGitRepoStoreTest/rootdir/proj1/DOTgit/HEAD: -------------------------------------------------------------------------------- 1 | ref: refs/heads/master 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/FSGitRepoStoreTest/rootdir/proj1/DOTgit/config: -------------------------------------------------------------------------------- 1 | [core] 2 | repositoryformatversion = 0 3 | filemode = true 4 | bare = false 5 | logallrefupdates = true 6 | ignorecase = true 7 | precomposeunicode = true 8 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/FSGitRepoStoreTest/rootdir/proj1/DOTgit/description: -------------------------------------------------------------------------------- 1 | Unnamed repository; edit this file 'description' to name the repository. 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/FSGitRepoStoreTest/rootdir/proj1/DOTgit/hooks/applypatch-msg.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to check the commit log message taken by 4 | # applypatch from an e-mail message. 5 | # 6 | # The hook should exit with non-zero status after issuing an 7 | # appropriate message if it wants to stop the commit. The hook is 8 | # allowed to edit the commit message file. 9 | # 10 | # To enable this hook, rename this file to "applypatch-msg". 11 | 12 | . git-sh-setup 13 | commitmsg="$(git rev-parse --git-path hooks/commit-msg)" 14 | test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"} 15 | : 16 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/FSGitRepoStoreTest/rootdir/proj1/DOTgit/hooks/commit-msg.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to check the commit log message. 4 | # Called by "git commit" with one argument, the name of the file 5 | # that has the commit message. The hook should exit with non-zero 6 | # status after issuing an appropriate message if it wants to stop the 7 | # commit. The hook is allowed to edit the commit message file. 8 | # 9 | # To enable this hook, rename this file to "commit-msg". 10 | 11 | # Uncomment the below to add a Signed-off-by line to the message. 12 | # Doing this in a hook is a bad idea in general, but the prepare-commit-msg 13 | # hook is more suited to it. 14 | # 15 | # SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') 16 | # grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" 17 | 18 | # This example catches duplicate Signed-off-by lines. 19 | 20 | test "" = "$(grep '^Signed-off-by: ' "$1" | 21 | sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { 22 | echo >&2 Duplicate Signed-off-by lines. 23 | exit 1 24 | } 25 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/FSGitRepoStoreTest/rootdir/proj1/DOTgit/hooks/post-update.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to prepare a packed repository for use over 4 | # dumb transports. 5 | # 6 | # To enable this hook, rename this file to "post-update". 7 | 8 | exec git update-server-info 9 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/FSGitRepoStoreTest/rootdir/proj1/DOTgit/hooks/pre-applypatch.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to verify what is about to be committed 4 | # by applypatch from an e-mail message. 5 | # 6 | # The hook should exit with non-zero status after issuing an 7 | # appropriate message if it wants to stop the commit. 8 | # 9 | # To enable this hook, rename this file to "pre-applypatch". 10 | 11 | . git-sh-setup 12 | precommit="$(git rev-parse --git-path hooks/pre-commit)" 13 | test -x "$precommit" && exec "$precommit" ${1+"$@"} 14 | : 15 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/FSGitRepoStoreTest/rootdir/proj1/DOTgit/index: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/FSGitRepoStoreTest/rootdir/proj1/DOTgit/index -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/FSGitRepoStoreTest/rootdir/proj1/DOTgit/info/exclude: -------------------------------------------------------------------------------- 1 | # git ls-files --others --exclude-from=.git/info/exclude 2 | # Lines that start with '#' are comments. 3 | # For a project mostly in C, the following would be a good set of 4 | # exclude patterns (uncomment them if you want to use them): 5 | # *.[oa] 6 | # *~ 7 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/FSGitRepoStoreTest/rootdir/proj1/DOTgit/logs/HEAD: -------------------------------------------------------------------------------- 1 | 0000000000000000000000000000000000000000 e5fc0d2678ec7b9bacf0bf514bac035fa371cb6e Winston Li 1471957665 +0100 commit (initial): Main 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/FSGitRepoStoreTest/rootdir/proj1/DOTgit/logs/refs/heads/master: -------------------------------------------------------------------------------- 1 | 0000000000000000000000000000000000000000 e5fc0d2678ec7b9bacf0bf514bac035fa371cb6e Winston Li 1471957665 +0100 commit (initial): Main 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/FSGitRepoStoreTest/rootdir/proj1/DOTgit/objects/8b/6f970d184c1e097e6e6bae9b0eb03fec7796bf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/FSGitRepoStoreTest/rootdir/proj1/DOTgit/objects/8b/6f970d184c1e097e6e6bae9b0eb03fec7796bf -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/FSGitRepoStoreTest/rootdir/proj1/DOTgit/objects/e5/fc0d2678ec7b9bacf0bf514bac035fa371cb6e: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/FSGitRepoStoreTest/rootdir/proj1/DOTgit/objects/e5/fc0d2678ec7b9bacf0bf514bac035fa371cb6e -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/FSGitRepoStoreTest/rootdir/proj1/DOTgit/objects/f2/7f21327e2f0f53e9d8afab217fedaeea6a1cee: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/FSGitRepoStoreTest/rootdir/proj1/DOTgit/objects/f2/7f21327e2f0f53e9d8afab217fedaeea6a1cee -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/FSGitRepoStoreTest/rootdir/proj1/DOTgit/refs/heads/master: -------------------------------------------------------------------------------- 1 | e5fc0d2678ec7b9bacf0bf514bac035fa371cb6e 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/FSGitRepoStoreTest/rootdir/proj2/DOTgit/COMMIT_EDITMSG: -------------------------------------------------------------------------------- 1 | Main 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/FSGitRepoStoreTest/rootdir/proj2/DOTgit/HEAD: -------------------------------------------------------------------------------- 1 | ref: refs/heads/master 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/FSGitRepoStoreTest/rootdir/proj2/DOTgit/config: -------------------------------------------------------------------------------- 1 | [core] 2 | repositoryformatversion = 0 3 | filemode = true 4 | bare = false 5 | logallrefupdates = true 6 | ignorecase = true 7 | precomposeunicode = true 8 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/FSGitRepoStoreTest/rootdir/proj2/DOTgit/description: -------------------------------------------------------------------------------- 1 | Unnamed repository; edit this file 'description' to name the repository. 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/FSGitRepoStoreTest/rootdir/proj2/DOTgit/hooks/applypatch-msg.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to check the commit log message taken by 4 | # applypatch from an e-mail message. 5 | # 6 | # The hook should exit with non-zero status after issuing an 7 | # appropriate message if it wants to stop the commit. The hook is 8 | # allowed to edit the commit message file. 9 | # 10 | # To enable this hook, rename this file to "applypatch-msg". 11 | 12 | . git-sh-setup 13 | commitmsg="$(git rev-parse --git-path hooks/commit-msg)" 14 | test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"} 15 | : 16 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/FSGitRepoStoreTest/rootdir/proj2/DOTgit/hooks/commit-msg.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to check the commit log message. 4 | # Called by "git commit" with one argument, the name of the file 5 | # that has the commit message. The hook should exit with non-zero 6 | # status after issuing an appropriate message if it wants to stop the 7 | # commit. The hook is allowed to edit the commit message file. 8 | # 9 | # To enable this hook, rename this file to "commit-msg". 10 | 11 | # Uncomment the below to add a Signed-off-by line to the message. 12 | # Doing this in a hook is a bad idea in general, but the prepare-commit-msg 13 | # hook is more suited to it. 14 | # 15 | # SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') 16 | # grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" 17 | 18 | # This example catches duplicate Signed-off-by lines. 19 | 20 | test "" = "$(grep '^Signed-off-by: ' "$1" | 21 | sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { 22 | echo >&2 Duplicate Signed-off-by lines. 23 | exit 1 24 | } 25 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/FSGitRepoStoreTest/rootdir/proj2/DOTgit/hooks/post-update.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to prepare a packed repository for use over 4 | # dumb transports. 5 | # 6 | # To enable this hook, rename this file to "post-update". 7 | 8 | exec git update-server-info 9 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/FSGitRepoStoreTest/rootdir/proj2/DOTgit/hooks/pre-applypatch.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to verify what is about to be committed 4 | # by applypatch from an e-mail message. 5 | # 6 | # The hook should exit with non-zero status after issuing an 7 | # appropriate message if it wants to stop the commit. 8 | # 9 | # To enable this hook, rename this file to "pre-applypatch". 10 | 11 | . git-sh-setup 12 | precommit="$(git rev-parse --git-path hooks/pre-commit)" 13 | test -x "$precommit" && exec "$precommit" ${1+"$@"} 14 | : 15 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/FSGitRepoStoreTest/rootdir/proj2/DOTgit/index: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/FSGitRepoStoreTest/rootdir/proj2/DOTgit/index -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/FSGitRepoStoreTest/rootdir/proj2/DOTgit/info/exclude: -------------------------------------------------------------------------------- 1 | # git ls-files --others --exclude-from=.git/info/exclude 2 | # Lines that start with '#' are comments. 3 | # For a project mostly in C, the following would be a good set of 4 | # exclude patterns (uncomment them if you want to use them): 5 | # *.[oa] 6 | # *~ 7 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/FSGitRepoStoreTest/rootdir/proj2/DOTgit/logs/HEAD: -------------------------------------------------------------------------------- 1 | 0000000000000000000000000000000000000000 6c12c073e5702530a9d06b83840d62f8a6621764 Winston Li 1471957694 +0100 commit (initial): Main 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/FSGitRepoStoreTest/rootdir/proj2/DOTgit/logs/refs/heads/master: -------------------------------------------------------------------------------- 1 | 0000000000000000000000000000000000000000 6c12c073e5702530a9d06b83840d62f8a6621764 Winston Li 1471957694 +0100 commit (initial): Main 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/FSGitRepoStoreTest/rootdir/proj2/DOTgit/objects/6c/12c073e5702530a9d06b83840d62f8a6621764: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/FSGitRepoStoreTest/rootdir/proj2/DOTgit/objects/6c/12c073e5702530a9d06b83840d62f8a6621764 -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/FSGitRepoStoreTest/rootdir/proj2/DOTgit/objects/7f/37654ebf6d0a19650abbcf5db3953b15001d1b: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/FSGitRepoStoreTest/rootdir/proj2/DOTgit/objects/7f/37654ebf6d0a19650abbcf5db3953b15001d1b -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/FSGitRepoStoreTest/rootdir/proj2/DOTgit/objects/d8/5308af36ff394df8bf063719b2aea26077aaea: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/FSGitRepoStoreTest/rootdir/proj2/DOTgit/objects/d8/5308af36ff394df8bf063719b2aea26077aaea -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/FSGitRepoStoreTest/rootdir/proj2/DOTgit/refs/heads/master: -------------------------------------------------------------------------------- 1 | 6c12c073e5702530a9d06b83840d62f8a6621764 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/badgitignore/.gitignore: -------------------------------------------------------------------------------- 1 | +*.ignored 2 | 3 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/badgitignore/DOTgit/COMMIT_EDITMSG: -------------------------------------------------------------------------------- 1 | Commit bad gitignore 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/badgitignore/DOTgit/HEAD: -------------------------------------------------------------------------------- 1 | ref: refs/heads/master 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/badgitignore/DOTgit/config: -------------------------------------------------------------------------------- 1 | [core] 2 | repositoryformatversion = 0 3 | filemode = true 4 | bare = false 5 | logallrefupdates = true 6 | ignorecase = true 7 | precomposeunicode = true 8 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/badgitignore/DOTgit/description: -------------------------------------------------------------------------------- 1 | Unnamed repository; edit this file 'description' to name the repository. 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/badgitignore/DOTgit/hooks/applypatch-msg.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to check the commit log message taken by 4 | # applypatch from an e-mail message. 5 | # 6 | # The hook should exit with non-zero status after issuing an 7 | # appropriate message if it wants to stop the commit. The hook is 8 | # allowed to edit the commit message file. 9 | # 10 | # To enable this hook, rename this file to "applypatch-msg". 11 | 12 | . git-sh-setup 13 | commitmsg="$(git rev-parse --git-path hooks/commit-msg)" 14 | test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"} 15 | : 16 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/badgitignore/DOTgit/hooks/commit-msg.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to check the commit log message. 4 | # Called by "git commit" with one argument, the name of the file 5 | # that has the commit message. The hook should exit with non-zero 6 | # status after issuing an appropriate message if it wants to stop the 7 | # commit. The hook is allowed to edit the commit message file. 8 | # 9 | # To enable this hook, rename this file to "commit-msg". 10 | 11 | # Uncomment the below to add a Signed-off-by line to the message. 12 | # Doing this in a hook is a bad idea in general, but the prepare-commit-msg 13 | # hook is more suited to it. 14 | # 15 | # SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') 16 | # grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" 17 | 18 | # This example catches duplicate Signed-off-by lines. 19 | 20 | test "" = "$(grep '^Signed-off-by: ' "$1" | 21 | sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { 22 | echo >&2 Duplicate Signed-off-by lines. 23 | exit 1 24 | } 25 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/badgitignore/DOTgit/hooks/post-update.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to prepare a packed repository for use over 4 | # dumb transports. 5 | # 6 | # To enable this hook, rename this file to "post-update". 7 | 8 | exec git update-server-info 9 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/badgitignore/DOTgit/hooks/pre-applypatch.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to verify what is about to be committed 4 | # by applypatch from an e-mail message. 5 | # 6 | # The hook should exit with non-zero status after issuing an 7 | # appropriate message if it wants to stop the commit. 8 | # 9 | # To enable this hook, rename this file to "pre-applypatch". 10 | 11 | . git-sh-setup 12 | precommit="$(git rev-parse --git-path hooks/pre-commit)" 13 | test -x "$precommit" && exec "$precommit" ${1+"$@"} 14 | : 15 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/badgitignore/DOTgit/index: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/badgitignore/DOTgit/index -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/badgitignore/DOTgit/info/exclude: -------------------------------------------------------------------------------- 1 | # git ls-files --others --exclude-from=.git/info/exclude 2 | # Lines that start with '#' are comments. 3 | # For a project mostly in C, the following would be a good set of 4 | # exclude patterns (uncomment them if you want to use them): 5 | # *.[oa] 6 | # *~ 7 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/badgitignore/DOTgit/logs/HEAD: -------------------------------------------------------------------------------- 1 | 0000000000000000000000000000000000000000 4a64431a59519ff25eff2cd94a561081146059b7 Winston Li 1475933347 +0100 commit (initial): Initial commit 2 | 4a64431a59519ff25eff2cd94a561081146059b7 71ebe5d70c8634f7531cc09c1cad5dae951a9052 Winston Li 1475933399 +0100 commit: Add ignored file 3 | 71ebe5d70c8634f7531cc09c1cad5dae951a9052 fe5adb3985be3ef5e790eaf9b1b41f862d64dfc1 Winston Li 1475938853 +0100 commit: Commit bad gitignore 4 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/badgitignore/DOTgit/logs/refs/heads/master: -------------------------------------------------------------------------------- 1 | 0000000000000000000000000000000000000000 4a64431a59519ff25eff2cd94a561081146059b7 Winston Li 1475933347 +0100 commit (initial): Initial commit 2 | 4a64431a59519ff25eff2cd94a561081146059b7 71ebe5d70c8634f7531cc09c1cad5dae951a9052 Winston Li 1475933399 +0100 commit: Add ignored file 3 | 71ebe5d70c8634f7531cc09c1cad5dae951a9052 fe5adb3985be3ef5e790eaf9b1b41f862d64dfc1 Winston Li 1475938853 +0100 commit: Commit bad gitignore 4 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/badgitignore/DOTgit/objects/23/462c896684e004db23cfab16255e176400643a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/badgitignore/DOTgit/objects/23/462c896684e004db23cfab16255e176400643a -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/badgitignore/DOTgit/objects/39/2f03252185fe21cb8926676deb84b60a617ff9: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/badgitignore/DOTgit/objects/39/2f03252185fe21cb8926676deb84b60a617ff9 -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/badgitignore/DOTgit/objects/4a/64431a59519ff25eff2cd94a561081146059b7: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/badgitignore/DOTgit/objects/4a/64431a59519ff25eff2cd94a561081146059b7 -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/badgitignore/DOTgit/objects/55/45880406d44a71c1c179cb17a5819b59cbbc36: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/badgitignore/DOTgit/objects/55/45880406d44a71c1c179cb17a5819b59cbbc36 -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/badgitignore/DOTgit/objects/71/ebe5d70c8634f7531cc09c1cad5dae951a9052: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/badgitignore/DOTgit/objects/71/ebe5d70c8634f7531cc09c1cad5dae951a9052 -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/badgitignore/DOTgit/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/badgitignore/DOTgit/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/badgitignore/DOTgit/objects/f5/b2fc4665b50e85c1b66594166f218f722a4af2: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/badgitignore/DOTgit/objects/f5/b2fc4665b50e85c1b66594166f218f722a4af2 -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/badgitignore/DOTgit/objects/f9/8c2cd38c5fae9c349214f6835f5b4aaa622216: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/badgitignore/DOTgit/objects/f9/8c2cd38c5fae9c349214f6835f5b4aaa622216 -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/badgitignore/DOTgit/objects/fe/5adb3985be3ef5e790eaf9b1b41f862d64dfc1: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/badgitignore/DOTgit/objects/fe/5adb3985be3ef5e790eaf9b1b41f862d64dfc1 -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/badgitignore/DOTgit/refs/heads/master: -------------------------------------------------------------------------------- 1 | fe5adb3985be3ef5e790eaf9b1b41f862d64dfc1 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/badgitignore/file1.ignored: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/badgitignore/file1.ignored -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/badgitignore/file1.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/badgitignore/file1.txt -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/badgitignore/file2.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/badgitignore/file2.txt -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/incoming/.gitignore: -------------------------------------------------------------------------------- 1 | *.ignored 2 | 3 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/incoming/DOTgit/COMMIT_EDITMSG: -------------------------------------------------------------------------------- 1 | Add ignored file 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/incoming/DOTgit/HEAD: -------------------------------------------------------------------------------- 1 | ref: refs/heads/master 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/incoming/DOTgit/config: -------------------------------------------------------------------------------- 1 | [core] 2 | repositoryformatversion = 0 3 | filemode = true 4 | bare = false 5 | logallrefupdates = true 6 | ignorecase = true 7 | precomposeunicode = true 8 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/incoming/DOTgit/description: -------------------------------------------------------------------------------- 1 | Unnamed repository; edit this file 'description' to name the repository. 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/incoming/DOTgit/hooks/applypatch-msg.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to check the commit log message taken by 4 | # applypatch from an e-mail message. 5 | # 6 | # The hook should exit with non-zero status after issuing an 7 | # appropriate message if it wants to stop the commit. The hook is 8 | # allowed to edit the commit message file. 9 | # 10 | # To enable this hook, rename this file to "applypatch-msg". 11 | 12 | . git-sh-setup 13 | commitmsg="$(git rev-parse --git-path hooks/commit-msg)" 14 | test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"} 15 | : 16 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/incoming/DOTgit/hooks/commit-msg.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to check the commit log message. 4 | # Called by "git commit" with one argument, the name of the file 5 | # that has the commit message. The hook should exit with non-zero 6 | # status after issuing an appropriate message if it wants to stop the 7 | # commit. The hook is allowed to edit the commit message file. 8 | # 9 | # To enable this hook, rename this file to "commit-msg". 10 | 11 | # Uncomment the below to add a Signed-off-by line to the message. 12 | # Doing this in a hook is a bad idea in general, but the prepare-commit-msg 13 | # hook is more suited to it. 14 | # 15 | # SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') 16 | # grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" 17 | 18 | # This example catches duplicate Signed-off-by lines. 19 | 20 | test "" = "$(grep '^Signed-off-by: ' "$1" | 21 | sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { 22 | echo >&2 Duplicate Signed-off-by lines. 23 | exit 1 24 | } 25 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/incoming/DOTgit/hooks/post-update.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to prepare a packed repository for use over 4 | # dumb transports. 5 | # 6 | # To enable this hook, rename this file to "post-update". 7 | 8 | exec git update-server-info 9 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/incoming/DOTgit/hooks/pre-applypatch.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to verify what is about to be committed 4 | # by applypatch from an e-mail message. 5 | # 6 | # The hook should exit with non-zero status after issuing an 7 | # appropriate message if it wants to stop the commit. 8 | # 9 | # To enable this hook, rename this file to "pre-applypatch". 10 | 11 | . git-sh-setup 12 | precommit="$(git rev-parse --git-path hooks/pre-commit)" 13 | test -x "$precommit" && exec "$precommit" ${1+"$@"} 14 | : 15 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/incoming/DOTgit/index: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/incoming/DOTgit/index -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/incoming/DOTgit/info/exclude: -------------------------------------------------------------------------------- 1 | # git ls-files --others --exclude-from=.git/info/exclude 2 | # Lines that start with '#' are comments. 3 | # For a project mostly in C, the following would be a good set of 4 | # exclude patterns (uncomment them if you want to use them): 5 | # *.[oa] 6 | # *~ 7 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/incoming/DOTgit/info/refs: -------------------------------------------------------------------------------- 1 | 71ebe5d70c8634f7531cc09c1cad5dae951a9052 refs/heads/master 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/incoming/DOTgit/logs/HEAD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/incoming/DOTgit/logs/HEAD -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/incoming/DOTgit/logs/refs/heads/master: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/incoming/DOTgit/logs/refs/heads/master -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/incoming/DOTgit/objects/incoming_4632440628786417060.pack: -------------------------------------------------------------------------------- 1 | blah blah blah 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/incoming/DOTgit/objects/incoming_4635689790689803605.pack: -------------------------------------------------------------------------------- 1 | i am a pack 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/incoming/DOTgit/objects/info/packs: -------------------------------------------------------------------------------- 1 | P pack-71e0b18bc4675e30d48c891ae9bfc2487ec6e0bb.pack 2 | 3 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/incoming/DOTgit/objects/pack/pack-71e0b18bc4675e30d48c891ae9bfc2487ec6e0bb.idx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/incoming/DOTgit/objects/pack/pack-71e0b18bc4675e30d48c891ae9bfc2487ec6e0bb.idx -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/incoming/DOTgit/objects/pack/pack-71e0b18bc4675e30d48c891ae9bfc2487ec6e0bb.pack: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/incoming/DOTgit/objects/pack/pack-71e0b18bc4675e30d48c891ae9bfc2487ec6e0bb.pack -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/incoming/DOTgit/packed-refs: -------------------------------------------------------------------------------- 1 | # pack-refs with: peeled fully-peeled 2 | 71ebe5d70c8634f7531cc09c1cad5dae951a9052 refs/heads/master 3 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/incoming/file1.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/incoming/file1.txt -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/incoming/file2.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/incoming/file2.txt -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/repo/.gitignore: -------------------------------------------------------------------------------- 1 | *.ignored 2 | 3 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/repo/DOTgit/COMMIT_EDITMSG: -------------------------------------------------------------------------------- 1 | Add ignored file 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/repo/DOTgit/HEAD: -------------------------------------------------------------------------------- 1 | ref: refs/heads/master 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/repo/DOTgit/config: -------------------------------------------------------------------------------- 1 | [core] 2 | repositoryformatversion = 0 3 | filemode = true 4 | bare = false 5 | logallrefupdates = true 6 | ignorecase = true 7 | precomposeunicode = true 8 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/repo/DOTgit/description: -------------------------------------------------------------------------------- 1 | Unnamed repository; edit this file 'description' to name the repository. 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/repo/DOTgit/hooks/applypatch-msg.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to check the commit log message taken by 4 | # applypatch from an e-mail message. 5 | # 6 | # The hook should exit with non-zero status after issuing an 7 | # appropriate message if it wants to stop the commit. The hook is 8 | # allowed to edit the commit message file. 9 | # 10 | # To enable this hook, rename this file to "applypatch-msg". 11 | 12 | . git-sh-setup 13 | commitmsg="$(git rev-parse --git-path hooks/commit-msg)" 14 | test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"} 15 | : 16 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/repo/DOTgit/hooks/commit-msg.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to check the commit log message. 4 | # Called by "git commit" with one argument, the name of the file 5 | # that has the commit message. The hook should exit with non-zero 6 | # status after issuing an appropriate message if it wants to stop the 7 | # commit. The hook is allowed to edit the commit message file. 8 | # 9 | # To enable this hook, rename this file to "commit-msg". 10 | 11 | # Uncomment the below to add a Signed-off-by line to the message. 12 | # Doing this in a hook is a bad idea in general, but the prepare-commit-msg 13 | # hook is more suited to it. 14 | # 15 | # SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') 16 | # grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" 17 | 18 | # This example catches duplicate Signed-off-by lines. 19 | 20 | test "" = "$(grep '^Signed-off-by: ' "$1" | 21 | sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { 22 | echo >&2 Duplicate Signed-off-by lines. 23 | exit 1 24 | } 25 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/repo/DOTgit/hooks/post-update.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to prepare a packed repository for use over 4 | # dumb transports. 5 | # 6 | # To enable this hook, rename this file to "post-update". 7 | 8 | exec git update-server-info 9 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/repo/DOTgit/hooks/pre-applypatch.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to verify what is about to be committed 4 | # by applypatch from an e-mail message. 5 | # 6 | # The hook should exit with non-zero status after issuing an 7 | # appropriate message if it wants to stop the commit. 8 | # 9 | # To enable this hook, rename this file to "pre-applypatch". 10 | 11 | . git-sh-setup 12 | precommit="$(git rev-parse --git-path hooks/pre-commit)" 13 | test -x "$precommit" && exec "$precommit" ${1+"$@"} 14 | : 15 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/repo/DOTgit/index: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/repo/DOTgit/index -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/repo/DOTgit/info/exclude: -------------------------------------------------------------------------------- 1 | # git ls-files --others --exclude-from=.git/info/exclude 2 | # Lines that start with '#' are comments. 3 | # For a project mostly in C, the following would be a good set of 4 | # exclude patterns (uncomment them if you want to use them): 5 | # *.[oa] 6 | # *~ 7 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/repo/DOTgit/logs/HEAD: -------------------------------------------------------------------------------- 1 | 0000000000000000000000000000000000000000 4a64431a59519ff25eff2cd94a561081146059b7 Winston Li 1475933347 +0100 commit (initial): Initial commit 2 | 4a64431a59519ff25eff2cd94a561081146059b7 71ebe5d70c8634f7531cc09c1cad5dae951a9052 Winston Li 1475933399 +0100 commit: Add ignored file 3 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/repo/DOTgit/logs/refs/heads/master: -------------------------------------------------------------------------------- 1 | 0000000000000000000000000000000000000000 4a64431a59519ff25eff2cd94a561081146059b7 Winston Li 1475933347 +0100 commit (initial): Initial commit 2 | 4a64431a59519ff25eff2cd94a561081146059b7 71ebe5d70c8634f7531cc09c1cad5dae951a9052 Winston Li 1475933399 +0100 commit: Add ignored file 3 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/repo/DOTgit/objects/23/462c896684e004db23cfab16255e176400643a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/repo/DOTgit/objects/23/462c896684e004db23cfab16255e176400643a -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/repo/DOTgit/objects/39/2f03252185fe21cb8926676deb84b60a617ff9: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/repo/DOTgit/objects/39/2f03252185fe21cb8926676deb84b60a617ff9 -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/repo/DOTgit/objects/4a/64431a59519ff25eff2cd94a561081146059b7: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/repo/DOTgit/objects/4a/64431a59519ff25eff2cd94a561081146059b7 -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/repo/DOTgit/objects/55/45880406d44a71c1c179cb17a5819b59cbbc36: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/repo/DOTgit/objects/55/45880406d44a71c1c179cb17a5819b59cbbc36 -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/repo/DOTgit/objects/71/ebe5d70c8634f7531cc09c1cad5dae951a9052: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/repo/DOTgit/objects/71/ebe5d70c8634f7531cc09c1cad5dae951a9052 -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/repo/DOTgit/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/repo/DOTgit/objects/e6/9de29bb2d1d6434b8b29ae775ad8c2e48c5391 -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/repo/DOTgit/refs/heads/master: -------------------------------------------------------------------------------- 1 | 71ebe5d70c8634f7531cc09c1cad5dae951a9052 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/repo/file1.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/repo/file1.txt -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/repo/file2.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/repo/file2.txt -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/without_incoming/.gitignore: -------------------------------------------------------------------------------- 1 | *.ignored 2 | 3 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/without_incoming/DOTgit/COMMIT_EDITMSG: -------------------------------------------------------------------------------- 1 | Add ignored file 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/without_incoming/DOTgit/HEAD: -------------------------------------------------------------------------------- 1 | ref: refs/heads/master 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/without_incoming/DOTgit/config: -------------------------------------------------------------------------------- 1 | [core] 2 | repositoryformatversion = 0 3 | filemode = true 4 | bare = false 5 | logallrefupdates = true 6 | ignorecase = true 7 | precomposeunicode = true 8 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/without_incoming/DOTgit/description: -------------------------------------------------------------------------------- 1 | Unnamed repository; edit this file 'description' to name the repository. 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/without_incoming/DOTgit/hooks/applypatch-msg.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to check the commit log message taken by 4 | # applypatch from an e-mail message. 5 | # 6 | # The hook should exit with non-zero status after issuing an 7 | # appropriate message if it wants to stop the commit. The hook is 8 | # allowed to edit the commit message file. 9 | # 10 | # To enable this hook, rename this file to "applypatch-msg". 11 | 12 | . git-sh-setup 13 | commitmsg="$(git rev-parse --git-path hooks/commit-msg)" 14 | test -x "$commitmsg" && exec "$commitmsg" ${1+"$@"} 15 | : 16 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/without_incoming/DOTgit/hooks/commit-msg.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to check the commit log message. 4 | # Called by "git commit" with one argument, the name of the file 5 | # that has the commit message. The hook should exit with non-zero 6 | # status after issuing an appropriate message if it wants to stop the 7 | # commit. The hook is allowed to edit the commit message file. 8 | # 9 | # To enable this hook, rename this file to "commit-msg". 10 | 11 | # Uncomment the below to add a Signed-off-by line to the message. 12 | # Doing this in a hook is a bad idea in general, but the prepare-commit-msg 13 | # hook is more suited to it. 14 | # 15 | # SOB=$(git var GIT_AUTHOR_IDENT | sed -n 's/^\(.*>\).*$/Signed-off-by: \1/p') 16 | # grep -qs "^$SOB" "$1" || echo "$SOB" >> "$1" 17 | 18 | # This example catches duplicate Signed-off-by lines. 19 | 20 | test "" = "$(grep '^Signed-off-by: ' "$1" | 21 | sort | uniq -c | sed -e '/^[ ]*1[ ]/d')" || { 22 | echo >&2 Duplicate Signed-off-by lines. 23 | exit 1 24 | } 25 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/without_incoming/DOTgit/hooks/post-update.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to prepare a packed repository for use over 4 | # dumb transports. 5 | # 6 | # To enable this hook, rename this file to "post-update". 7 | 8 | exec git update-server-info 9 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/without_incoming/DOTgit/hooks/pre-applypatch.sample: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # An example hook script to verify what is about to be committed 4 | # by applypatch from an e-mail message. 5 | # 6 | # The hook should exit with non-zero status after issuing an 7 | # appropriate message if it wants to stop the commit. 8 | # 9 | # To enable this hook, rename this file to "pre-applypatch". 10 | 11 | . git-sh-setup 12 | precommit="$(git rev-parse --git-path hooks/pre-commit)" 13 | test -x "$precommit" && exec "$precommit" ${1+"$@"} 14 | : 15 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/without_incoming/DOTgit/index: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/without_incoming/DOTgit/index -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/without_incoming/DOTgit/info/exclude: -------------------------------------------------------------------------------- 1 | # git ls-files --others --exclude-from=.git/info/exclude 2 | # Lines that start with '#' are comments. 3 | # For a project mostly in C, the following would be a good set of 4 | # exclude patterns (uncomment them if you want to use them): 5 | # *.[oa] 6 | # *~ 7 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/without_incoming/DOTgit/info/refs: -------------------------------------------------------------------------------- 1 | 71ebe5d70c8634f7531cc09c1cad5dae951a9052 refs/heads/master 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/without_incoming/DOTgit/logs/HEAD: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/without_incoming/DOTgit/logs/HEAD -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/without_incoming/DOTgit/logs/refs/heads/master: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/without_incoming/DOTgit/logs/refs/heads/master -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/without_incoming/DOTgit/objects/info/packs: -------------------------------------------------------------------------------- 1 | P pack-71e0b18bc4675e30d48c891ae9bfc2487ec6e0bb.pack 2 | 3 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/without_incoming/DOTgit/objects/pack/pack-71e0b18bc4675e30d48c891ae9bfc2487ec6e0bb.idx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/without_incoming/DOTgit/objects/pack/pack-71e0b18bc4675e30d48c891ae9bfc2487ec6e0bb.idx -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/without_incoming/DOTgit/objects/pack/pack-71e0b18bc4675e30d48c891ae9bfc2487ec6e0bb.pack: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/without_incoming/DOTgit/objects/pack/pack-71e0b18bc4675e30d48c891ae9bfc2487ec6e0bb.pack -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/without_incoming/DOTgit/packed-refs: -------------------------------------------------------------------------------- 1 | # pack-refs with: peeled fully-peeled 2 | 71ebe5d70c8634f7531cc09c1cad5dae951a9052 refs/heads/master 3 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/without_incoming/file1.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/without_incoming/file1.txt -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/without_incoming/file2.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/bridge/repo/GitProjectRepoTest/rootdir/without_incoming/file2.txt -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsFalseIfFileNamesAreNotEqual/neq1/file.txt: -------------------------------------------------------------------------------- 1 | 12345 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsFalseIfFileNamesAreNotEqual/neq1/neq1.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsFalseIfFileNamesAreNotEqual/neq1/neq1.txt -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsFalseIfFileNamesAreNotEqual/neq2/file.txt: -------------------------------------------------------------------------------- 1 | 12345 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsFalseIfFileNamesAreNotEqual/neq2/neq2.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsFalseIfFileNamesAreNotEqual/neq2/neq2.txt -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsFalseIfInnerDirectoryNamesAreNotEqual/neq1/neq1/file.txt: -------------------------------------------------------------------------------- 1 | 12345 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsFalseIfInnerDirectoryNamesAreNotEqual/neq2/neq2/file.txt: -------------------------------------------------------------------------------- 1 | 12345 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsFalseWhenFilesAreNotEqualInBothDirectories/neq1/file.txt: -------------------------------------------------------------------------------- 1 | 12345 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsFalseWhenFilesAreNotEqualInBothDirectories/neq2/file.txt: -------------------------------------------------------------------------------- 1 | 1234 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsFalseWhenRecursiveFilesAreNotEqualInBothDirectories/neq1/dir/file.txt: -------------------------------------------------------------------------------- 1 | 1234 -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsFalseWhenRecursiveFilesAreNotEqualInBothDirectories/neq1/file.txt: -------------------------------------------------------------------------------- 1 | 12345 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsFalseWhenRecursiveFilesAreNotEqualInBothDirectories/neq2/dir/file.txt: -------------------------------------------------------------------------------- 1 | 123 -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsFalseWhenRecursiveFilesAreNotEqualInBothDirectories/neq2/file.txt: -------------------------------------------------------------------------------- 1 | 12345 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsTrueEvenIfGitDirectoriesAreNotEqual/eq1/dir/file.txt: -------------------------------------------------------------------------------- 1 | 123 -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsTrueEvenIfGitDirectoriesAreNotEqual/eq1/file.txt: -------------------------------------------------------------------------------- 1 | 12345 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsTrueEvenIfGitDirectoriesAreNotEqual/eq2/dir/file.txt: -------------------------------------------------------------------------------- 1 | 123 -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsTrueEvenIfGitDirectoriesAreNotEqual/eq2/file.txt: -------------------------------------------------------------------------------- 1 | 12345 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsTrueWhenFilesAreEqualInBothDirectories/eq1/file.txt: -------------------------------------------------------------------------------- 1 | 12345 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsTrueWhenFilesAreEqualInBothDirectories/eq2/file.txt: -------------------------------------------------------------------------------- 1 | 12345 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsTrueWhenRecursiveFilesAreEqualInBothDirectories/eq1/dir/file.txt: -------------------------------------------------------------------------------- 1 | 123 -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsTrueWhenRecursiveFilesAreEqualInBothDirectories/eq1/file.txt: -------------------------------------------------------------------------------- 1 | 12345 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsTrueWhenRecursiveFilesAreEqualInBothDirectories/eq2/dir/file.txt: -------------------------------------------------------------------------------- 1 | 123 -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/snapshot/servermock/util/FileUtilTest/returnsTrueWhenRecursiveFilesAreEqualInBothDirectories/eq2/file.txt: -------------------------------------------------------------------------------- 1 | 12345 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/util/TarTest/dir_with_empty_file/empty: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/src/test/resources/uk/ac/ic/wlgitbridge/util/TarTest/dir_with_empty_file/empty -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/util/TarTest/testdir/file1: -------------------------------------------------------------------------------- 1 | file1 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/util/TarTest/testdir/file2: -------------------------------------------------------------------------------- 1 | file2 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/util/TarTest/testdir/nest1/file1: -------------------------------------------------------------------------------- 1 | nest1/file1 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/util/TarTest/testdir/nest1/file2: -------------------------------------------------------------------------------- 1 | nest1file2 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/util/TarTest/testdir/nest1/file3: -------------------------------------------------------------------------------- 1 | nest1/file3 2 | -------------------------------------------------------------------------------- /src/test/resources/uk/ac/ic/wlgitbridge/util/TarTest/testdir/nest1/nest2/file1: -------------------------------------------------------------------------------- 1 | nest1/nest2/file1 2 | -------------------------------------------------------------------------------- /start.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | /opt/envsubst < /envsubst_template.json > /conf/runtime.json 4 | 5 | VERSION=$(date +%y%m%d%H%M%S) 6 | 7 | if [ "x$GIT_BRIDGE_JVM_ARGS" == "x" ]; then 8 | GIT_BRIDGE_JVM_ARGS="-XX:+UseContainerSupport -XX:MaxRAMPercentage=50.0" 9 | fi 10 | 11 | if [ "$ENABLE_PROFILE_AGENT" == "true" ]; then 12 | GIT_BRIDGE_JVM_ARGS="-agentpath:/opt/cprof/profiler_java_agent.so=-cprof_service=git-bridge,-cprof_service_version=${VERSION},-cprof_enable_heap_sampling=true ${GIT_BRIDGE_JVM_ARGS}" 13 | fi 14 | 15 | if [ "$ENABLE_DEBUG_AGENT" == "true" ]; then 16 | GIT_BRIDGE_JVM_ARGS="-agentpath:/opt/cdbg/cdbg_java_agent.so -Dcom.google.cdbg.module=git-bridge -Dcom.google.cdbg.version=$VERSION ${GIT_BRIDGE_JVM_ARGS}" 17 | fi 18 | 19 | exec java $GIT_BRIDGE_JVM_ARGS -jar /git-bridge.jar /conf/runtime.json 20 | -------------------------------------------------------------------------------- /vendor/envsubst: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/overleaf/writelatex-git-bridge/1f9e8afae2f20dbaa245ae4685c9349ea2798e9c/vendor/envsubst --------------------------------------------------------------------------------