pub struct GitFastImporter<T: Write> { /* private fields */ }Expand description
Generates a git fast-import stream.
Write the stream to any Write implementor, then pipe it to git fast-import.
Implementations§
Source§impl<T: Write> GitFastImporter<T>
impl<T: Write> GitFastImporter<T>
Sourcepub fn new(
output: T,
branch: String,
initial_parent: Option<String>,
author: String,
) -> Self
pub fn new( output: T, branch: String, initial_parent: Option<String>, author: String, ) -> Self
Creates a new importer that writes to the given output.
§Arguments
output- The writer to output the fast-import stream tobranch- The branch name to create commits on (e.g.,"main")initial_parent- Optional parent ref for the first commit (e.g.,"refs/heads/main")author- The committer string (e.g.,GITHUB_BOT_AUTHOR)
Sourcepub fn start_commit(
&mut self,
message: &str,
timestamp: DateTime<impl TimeZone<Offset: Display>>,
) -> CommitBuilder<'_, T>
pub fn start_commit( &mut self, message: &str, timestamp: DateTime<impl TimeZone<Offset: Display>>, ) -> CommitBuilder<'_, T>
Starts building a new commit.
§Arguments
message- The commit messagetimestamp- The commit timestamp (e.g.,Utc::now())
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for GitFastImporter<T>where
T: Freeze,
impl<T> RefUnwindSafe for GitFastImporter<T>where
T: RefUnwindSafe,
impl<T> Send for GitFastImporter<T>where
T: Send,
impl<T> Sync for GitFastImporter<T>where
T: Sync,
impl<T> Unpin for GitFastImporter<T>where
T: Unpin,
impl<T> UnwindSafe for GitFastImporter<T>where
T: UnwindSafe,
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