createBranch method
Implementation
Future<GitHash?> createBranch(
String name, {
GitHash? hash,
bool overwrite = false,
}) async {
hash ??= await headHash();
if (hash == null) {
return null;
}
var branch = ReferenceName.branch(name);
var ref = await refStorage.reference(branch);
if (!overwrite && ref != null) {
return null;
}
await refStorage.saveRef(Reference.hash(branch, hash));
return hash;
}