Skip to content

Commit

Permalink
Fix errors
Browse files Browse the repository at this point in the history
  • Loading branch information
adutra committed Apr 26, 2023
1 parent 21c0773 commit 479615d
Show file tree
Hide file tree
Showing 8 changed files with 163 additions and 95 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -220,11 +220,4 @@ public PaginationIterator<Diff> getDiffs(Ref from, Ref to, String pagingToken)
public Stream<RefLogDetails> getRefLog(Hash refLogId) throws RefLogNotFoundException {
return delegate.getRefLog(refLogId);
}

@Nonnull
@jakarta.annotation.Nonnull
@Override
public RepositoryInformation getRepositoryInformation() {
return delegate.getRepositoryInformation();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ enum ConflictType {
UNRESOLVABLE
}

static <COMMIT> ImmutableMergeResult.Builder<COMMIT> builder() {
static <COMMIT extends Hashable> ImmutableMergeResult.Builder<COMMIT> builder() {
return ImmutableMergeResult.builder();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -122,16 +122,16 @@ public CommitMeta squash(List<CommitMeta> metadata) {
.build())
.build();

MergeResult<Object> dummyMergeResult =
MergeResult.builder()
MergeResult<Commit> dummyMergeResult =
MergeResult.<Commit>builder()
.resultType(ResultType.MERGE)
.sourceRef(BranchName.of("foo"))
.targetBranch(BranchName.of("bar"))
.effectiveTargetHash(Hash.of("123456"))
.build();

MergeResult<Object> dummyTransplantResult =
MergeResult.builder()
MergeResult<Commit> dummyTransplantResult =
MergeResult.<Commit>builder()
.resultType(ResultType.TRANSPLANT)
.sourceRef(BranchName.of("foo"))
.targetBranch(BranchName.of("bar"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -107,16 +107,16 @@ public CommitMeta squash(List<CommitMeta> metadata) {
.build())
.build();

MergeResult<Object> dummyMergeResult =
MergeResult.builder()
MergeResult<Commit> dummyMergeResult =
MergeResult.<Commit>builder()
.resultType(ResultType.MERGE)
.sourceRef(BranchName.of("foo"))
.targetBranch(BranchName.of("bar"))
.effectiveTargetHash(Hash.of("123456"))
.build();

MergeResult<Object> dummyTransplantResult =
MergeResult.builder()
MergeResult<Commit> dummyTransplantResult =
MergeResult.<Commit>builder()
.resultType(ResultType.TRANSPLANT)
.sourceRef(BranchName.of("foo"))
.targetBranch(BranchName.of("bar"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -648,14 +648,15 @@ void commitWithModifiedExpectedValue() throws Exception {

ObjId tip =
requireNonNull(
commitLogic.doCommit(
newCommitBuilder()
.headers(EMPTY_COMMIT_HEADERS)
.message("msg foo")
.parentCommitId(EMPTY_OBJ_ID)
.addAdds(commitAdd(key, 0, correctValue, null, null))
.build(),
emptyList()));
commitLogic.doCommit(
newCommitBuilder()
.headers(EMPTY_COMMIT_HEADERS)
.message("msg foo")
.parentCommitId(EMPTY_OBJ_ID)
.addAdds(commitAdd(key, 0, correctValue, null, null))
.build(),
emptyList()))
.id();

// Put the correct expected value into the Commit-ADD operation, but "break" it in the callback
// by adding a wrong expected value-ID.
Expand Down Expand Up @@ -714,14 +715,15 @@ void commitWithModifiedCommittedValue() throws Exception {

ObjId tip =
requireNonNull(
commitLogic.doCommit(
newCommitBuilder()
.headers(EMPTY_COMMIT_HEADERS)
.message("msg foo")
.parentCommitId(EMPTY_OBJ_ID)
.addAdds(commitAdd(key, 0, initialValue, null, null))
.build(),
emptyList()));
commitLogic.doCommit(
newCommitBuilder()
.headers(EMPTY_COMMIT_HEADERS)
.message("msg foo")
.parentCommitId(EMPTY_OBJ_ID)
.addAdds(commitAdd(key, 0, initialValue, null, null))
.build(),
emptyList()))
.id();

CommitObj commit =
commitLogic.buildCommitObj(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -417,6 +417,8 @@ private void commitAddPut(

private String contentIdFromContent(@Nonnull @jakarta.annotation.Nonnull ObjId contentValueId)
throws ObjNotFoundException {
// TODO pre-load these objects, so they are bulk-loaded and in turn available via the cache
// https://github.com/projectnessie/nessie/issues/6673
return contentMapping.fetchContent(contentValueId).getId();
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -652,12 +652,7 @@ public MergeResult<Commit> merge(
supplier,
(merge, retryState) ->
merge.merge(
retryState,
fromRef,
fromHash,
updateCommitMetadata,
mergeBehaviors,
dryRun));
retryState, fromRef, fromHash, updateCommitMetadata, mergeBehaviors, dryRun));

return mergeTransplantResponse(mergeResult);
}
Expand Down

0 comments on commit 479615d

Please sign in to comment.