Struct git_ref::file::Transaction[][src]

pub struct Transaction<'s> { /* fields omitted */ }
Expand description

A transaction on a file store

Implementations

Prepare for calling commit(…) in a way that can be rolled back perfectly.

If the operation succeeds, the transaction can be committed or dropped to cause a rollback automatically. Rollbacks happen automatically on failure and they tend to be perfect. This method is idempotent.

Make all prepared permanent and return the performed edits which represent the current state of the affected refs in the ref store in that instant. Please note that the obtained edits may have been adjusted to contain more dependent edits or additional information. committer is used in the reflog.

On error the transaction may have been performed partially, depending on the nature of the error, and no attempt to roll back partial changes is made.

In this stage, we perform the following operations:

  • update the ref log
  • move updated refs into place
  • delete reflogs and empty parent directories
  • delete packed refs
  • delete their corresponding reference (if applicable) along with empty parent directories

Note that transactions will be prepared automatically as needed.

Configure the way packed refs are handled during the transaction

Configure the namespace within which all edits should take place. For example, with namespace foo, edits destined for HEAD will affect refs/namespaces/foo/HEAD instead. Set None to not use any namespace, which also is the default.

This also means that edits returned when commit(…)ing will have their name altered to include the namespace automatically, so it must be stripped when returning them to the user to keep them ‘invisible’.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.