From c18fa1d1471146305b0f678ae527dcd3983315b6 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sat, 1 Sep 2018 16:16:40 +0100 Subject: [PATCH] Update ti use mon 0.12.0 API for Result --- src/main/java/net/kemitix/gitdb/impl/GitDBRepo.java | 2 +- src/main/java/net/kemitix/gitdb/impl/LocalGitDBImpl.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/net/kemitix/gitdb/impl/GitDBRepo.java b/src/main/java/net/kemitix/gitdb/impl/GitDBRepo.java index 20e759e..36841d3 100644 --- a/src/main/java/net/kemitix/gitdb/impl/GitDBRepo.java +++ b/src/main/java/net/kemitix/gitdb/impl/GitDBRepo.java @@ -85,7 +85,7 @@ class GitDBRepo { ) { final GitTreeReader treeFilter = new GitTreeReader(repository).treeFilter(key); return streamTree(branchRef, treeFilter).flatMap(s -> - Result.invert(s.findFirst() + Result.swap(s.findFirst() .map(NamedRevBlob::blobAsString) .map(Maybe::just) .orElseGet(Maybe::nothing))); diff --git a/src/main/java/net/kemitix/gitdb/impl/LocalGitDBImpl.java b/src/main/java/net/kemitix/gitdb/impl/LocalGitDBImpl.java index 6ac5c17..fac9502 100644 --- a/src/main/java/net/kemitix/gitdb/impl/LocalGitDBImpl.java +++ b/src/main/java/net/kemitix/gitdb/impl/LocalGitDBImpl.java @@ -114,7 +114,7 @@ final class LocalGitDBImpl implements GitDB, LocalGitDB { public Result> branch(final String name) { return Result.flatMapMaybe( Result.of(() -> Maybe.maybe(repository.findRef(name))), - refMaybe -> Result.invert(refMaybe.map(branchInit))); + refMaybe -> Result.swap(refMaybe.map(branchInit))); } }