Skip to main content

GitFastImporter

Struct GitFastImporter 

Source
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>

Source

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 to
  • branch - 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)
Source

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 message
  • timestamp - The commit timestamp (e.g., Utc::now())
Source

pub fn finish(&mut self) -> Result<()>

Writes the done command to finalize the stream.

Trait Implementations§

Source§

impl<T: Debug + Write> Debug for GitFastImporter<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.