pub struct Repository {
pub name: String,
pub owner: String,
pub objects: Arc<ObjectStore>,
pub refs: Arc<RefStore>,
}Expand description
A git repository with objects and references.
Fields§
§name: StringRepository name.
owner: StringRepository owner (public key hex).
objects: Arc<ObjectStore>Object store.
refs: Arc<RefStore>Reference store.
Implementations§
Source§impl Repository
impl Repository
Sourcepub fn new(name: impl Into<String>, owner: impl Into<String>) -> Self
pub fn new(name: impl Into<String>, owner: impl Into<String>) -> Self
Creates a new empty repository.
Sourcepub fn current_branch(&self) -> Option<String>
pub fn current_branch(&self) -> Option<String>
Gets the current branch name.
Sourcepub fn commit(
&self,
tree_id: &ObjectId,
message: &str,
author: &str,
committer: &str,
) -> Result<ObjectId>
pub fn commit( &self, tree_id: &ObjectId, message: &str, author: &str, committer: &str, ) -> Result<ObjectId>
Creates a new commit.
Sourcepub fn update_ref(&self, name: &str, target: ObjectId)
pub fn update_ref(&self, name: &str, target: ObjectId)
Updates a reference.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Repository
impl !RefUnwindSafe for Repository
impl Send for Repository
impl Sync for Repository
impl Unpin for Repository
impl !UnwindSafe for Repository
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more