Skip to content
Permalink
Browse files
checkout bot: use full path for marks files
Reviewed-by: rwestberg
  • Loading branch information
edvbld committed Aug 27, 2020
1 parent 0d9698b commit 8a2d11c6523a2ea1841ff396e09215b3f8852942
@@ -55,7 +55,7 @@ public List<Bot> create(BotConfiguration configuration) {
var fromBranch = new Branch(from.substring(lastColon + 1));
var to = Path.of(repo.get("to").asString());

var repoName = Path.of(fromURI.getPath()).getFileName().toString();
var repoName = fromURI.getPath();
var markStorage = MarkStorage.create(marksRepo, marksUser, repoName);

bots.add(new CheckoutBot(fromURI, fromBranch, to, storage, markStorage));
@@ -84,7 +84,7 @@ private static Set<Mark> deserialize(String current) {
}

static StorageBuilder<Mark> create(HostedRepository repo, Author user, String name) {
return new StorageBuilder<Mark>(name + ".marks.txt")
return new StorageBuilder<Mark>(name + "/marks.txt")
.remoteRepository(repo, "master", user.name(), user.email(), "Updated marks for " + name)
.serializer(MarkStorage::serialize)
.deserializer(MarkStorage::deserialize);
@@ -69,6 +69,8 @@ private static Repository tryMaterialize(HostedRepository repository, Path local
} catch (IOException ignored) {
// The remote ref may not yet exist
Repository localRepository = Repository.init(localStorage, repository.repositoryType());
var file = localStorage.resolve(fileName);
Files.createDirectories(file.getParent());
var storage = Files.writeString(localStorage.resolve(fileName), "");
localRepository.add(storage);
var firstCommit = localRepository.commit(message, authorName, authorEmail);

1 comment on commit 8a2d11c

@bridgekeeper
Copy link

@bridgekeeper bridgekeeper bot commented on 8a2d11c Aug 27, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.