seed method
Makes a commit of files on branch directly on the server.
Implementation
Future<GitObjectId> seed(
Map<String, List<int>> files, {
String? branch,
String message = 'seed',
}) async {
final ref = 'refs/heads/${branch ?? defaultBranch}';
final parent = await repository.refs.read(ref);
final base = parent == null
? null
: (await repository.readCommit(parent)).tree;
final tree = await repository.editTree(base, writes: files);
final commit = await repository.commit(
tree: tree,
parents: [?parent],
message: message,
author: GitPerson(
name: 'Server',
email: 'server@test',
seconds: 1700000000,
),
);
await repository.refs.write(ref, commit);
return commit;
}