mirror of
https://github.com/SkinnyMind/libgit2dart.git
synced 2025-05-05 12:49:08 -04:00
feat(blob): add bindings and api
This commit is contained in:
parent
88d064bda2
commit
f0803298c8
14 changed files with 455 additions and 143 deletions
|
@ -10,6 +10,7 @@ import 'oid.dart';
|
|||
import 'reference.dart';
|
||||
import 'revwalk.dart';
|
||||
import 'revparse.dart';
|
||||
import 'blob.dart';
|
||||
import 'enums.dart';
|
||||
import 'util.dart';
|
||||
|
||||
|
@ -379,4 +380,21 @@ class Repository {
|
|||
two.pointer,
|
||||
));
|
||||
}
|
||||
|
||||
/// Creates a new blob from a [content] string and writes it to ODB.
|
||||
///
|
||||
/// Throws a [LibGit2Error] if error occured.
|
||||
Oid createBlob(String content) => Blob.create(this, content);
|
||||
|
||||
/// Creates a new blob from the file in working directory of a repository and writes
|
||||
/// it to the ODB. Provided [path] should be relative to the working directory.
|
||||
///
|
||||
/// Throws a [LibGit2Error] if error occured.
|
||||
Oid createBlobFromWorkdir(String relativePath) =>
|
||||
Blob.createFromWorkdir(this, relativePath);
|
||||
|
||||
/// Creates a new blob from the file in filesystem and writes it to the ODB.
|
||||
///
|
||||
/// Throws a [LibGit2Error] if error occured.
|
||||
Oid createBlobFromDisk(String path) => Blob.createFromDisk(this, path);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue