@Test void testRenameWithConflict() { repo.commit(HEAD, 0L, Author.UNKNOWN, SUMMARY, jsonUpserts[0]).join(); assertThatThrownBy(() -> repo.commit(HEAD, 0L, Author.UNKNOWN, SUMMARY, Change.ofRename(jsonPaths[0], jsonPaths[0])).join()) .isInstanceOf(CompletionException.class) .hasCauseInstanceOf(ChangeConflictException.class); }
@Override public CompletableFuture<Revision> commit( Revision baseRevision, long commitTimeMillis, Author author, String summary, String detail, Markup markup, Iterable<Change<?>> changes) { final ServiceRequestContext ctx = context(); return CompletableFuture.supplyAsync(() -> { failFastIfTimedOut(this, logger, ctx, "commit", baseRevision, author, summary); return blockingCommit(baseRevision, commitTimeMillis, author, summary, detail, markup, changes, false); }, repositoryWorker); }
GitRepository implements Repository { @Override public CompletableFuture<Revision> commit( Revision baseRevision, long commitTimeMillis, Author author, String summary, String detail, Markup markup, Iterable<Change<?>> changes) { final ServiceRequestContext ctx = context(); return CompletableFuture.supplyAsync(() -> { failFastIfTimedOut(this, logger, ctx, "commit", baseRevision, author, summary); return blockingCommit(baseRevision, commitTimeMillis, author, summary, detail, markup, changes, false); }, repositoryWorker); } }
GitRepository implements Repository { @Override public CompletableFuture<Revision> commit( Revision baseRevision, long commitTimeMillis, Author author, String summary, String detail, Markup markup, Iterable<Change<?>> changes) { final ServiceRequestContext ctx = context(); return CompletableFuture.supplyAsync(() -> { failFastIfTimedOut(this, logger, ctx, "commit", baseRevision, author, summary); return blockingCommit(baseRevision, commitTimeMillis, author, summary, detail, markup, changes, false); }, repositoryWorker); } @VisibleForTesting  GitRepository(Project parent, File repoDir, Executor repositoryWorker,
                  long creationTimeMillis, Author author);   GitRepository(Project parent, File repoDir, GitRepositoryFormat format, Executor repositoryWorker,
                  long creationTimeMillis, Author author, @Nullable RepositoryCache cache);   GitRepository(Project parent, File repoDir, Executor repositoryWorker, @Nullable RepositoryCache cache); }
GitRepository implements Repository { @Override public CompletableFuture<Revision> commit( Revision baseRevision, long commitTimeMillis, Author author, String summary, String detail, Markup markup, Iterable<Change<?>> changes) { final ServiceRequestContext ctx = context(); return CompletableFuture.supplyAsync(() -> { failFastIfTimedOut(this, logger, ctx, "commit", baseRevision, author, summary); return blockingCommit(baseRevision, commitTimeMillis, author, summary, detail, markup, changes, false); }, repositoryWorker); } @VisibleForTesting  GitRepository(Project parent, File repoDir, Executor repositoryWorker,
                  long creationTimeMillis, Author author);   GitRepository(Project parent, File repoDir, GitRepositoryFormat format, Executor repositoryWorker,
                  long creationTimeMillis, Author author, @Nullable RepositoryCache cache);   GitRepository(Project parent, File repoDir, Executor repositoryWorker, @Nullable RepositoryCache cache); @Override Project parent(); @Override String name(); GitRepositoryFormat format(); boolean needsMigration(GitRepositoryFormat preferredFormat); @Override Revision normalizeNow(Revision revision); @Override RevisionRange normalizeNow(Revision from, Revision to); @Override CompletableFuture<Map<String, Entry<?>>> find(
            Revision revision, String pathPattern, Map<FindOption<?>, ?> options); @Override CompletableFuture<List<Commit>> history(
            Revision from, Revision to, String pathPattern, int maxCommits); @Override CompletableFuture<Map<String, Change<?>>> diff(Revision from, Revision to, String pathPattern); @Override CompletableFuture<Map<String, Change<?>>> previewDiff(Revision baseRevision,
                                                                 Iterable<Change<?>> changes); @Override CompletableFuture<Revision> commit(
            Revision baseRevision, long commitTimeMillis, Author author, String summary,
            String detail, Markup markup, Iterable<Change<?>> changes); @Override CompletableFuture<Revision> findLatestRevision(Revision lastKnownRevision, String pathPattern); @Override CompletableFuture<Revision> watch(Revision lastKnownRevision, String pathPattern); void cloneTo(File newRepoDir); void cloneTo(File newRepoDir, BiConsumer<Integer, Integer> progressListener); void cloneTo(File newRepoDir, GitRepositoryFormat format); void cloneTo(File newRepoDir, GitRepositoryFormat format,
                        BiConsumer<Integer, Integer> progressListener); @Override String toString(); }
GitRepository implements Repository { @Override public CompletableFuture<Revision> commit( Revision baseRevision, long commitTimeMillis, Author author, String summary, String detail, Markup markup, Iterable<Change<?>> changes) { final ServiceRequestContext ctx = context(); return CompletableFuture.supplyAsync(() -> { failFastIfTimedOut(this, logger, ctx, "commit", baseRevision, author, summary); return blockingCommit(baseRevision, commitTimeMillis, author, summary, detail, markup, changes, false); }, repositoryWorker); } @VisibleForTesting  GitRepository(Project parent, File repoDir, Executor repositoryWorker,
                  long creationTimeMillis, Author author);   GitRepository(Project parent, File repoDir, GitRepositoryFormat format, Executor repositoryWorker,
                  long creationTimeMillis, Author author, @Nullable RepositoryCache cache);   GitRepository(Project parent, File repoDir, Executor repositoryWorker, @Nullable RepositoryCache cache); @Override Project parent(); @Override String name(); GitRepositoryFormat format(); boolean needsMigration(GitRepositoryFormat preferredFormat); @Override Revision normalizeNow(Revision revision); @Override RevisionRange normalizeNow(Revision from, Revision to); @Override CompletableFuture<Map<String, Entry<?>>> find(
            Revision revision, String pathPattern, Map<FindOption<?>, ?> options); @Override CompletableFuture<List<Commit>> history(
            Revision from, Revision to, String pathPattern, int maxCommits); @Override CompletableFuture<Map<String, Change<?>>> diff(Revision from, Revision to, String pathPattern); @Override CompletableFuture<Map<String, Change<?>>> previewDiff(Revision baseRevision,
                                                                 Iterable<Change<?>> changes); @Override CompletableFuture<Revision> commit(
            Revision baseRevision, long commitTimeMillis, Author author, String summary,
            String detail, Markup markup, Iterable<Change<?>> changes); @Override CompletableFuture<Revision> findLatestRevision(Revision lastKnownRevision, String pathPattern); @Override CompletableFuture<Revision> watch(Revision lastKnownRevision, String pathPattern); void cloneTo(File newRepoDir); void cloneTo(File newRepoDir, BiConsumer<Integer, Integer> progressListener); void cloneTo(File newRepoDir, GitRepositoryFormat format); void cloneTo(File newRepoDir, GitRepositoryFormat format,
                        BiConsumer<Integer, Integer> progressListener); @Override String toString();  }