Skip to main content

Tracked

Struct Tracked 

Source
pub struct Tracked {
    pub path: Vec<u8>,
    pub id: Vec<u8>,
    pub mode: u32,
    pub intent_to_add: bool,
}
Expand description

One tracked path, as the index records it.

Fields§

§path: Vec<u8>

The path, spelled exactly as the index spells it.

§id: Vec<u8>

Object id of its cleaned content.

§mode: u32

The entry mode: 0o100644, 0o100755, 0o120000 for a symbolic link, 0o160000 for a submodule.

Carried rather than dropped, and the reason is not tidiness. Measured on the build before it was: status --fix read a tracked symlink as ordinary content — a symlink’s blob is its target string, which carries no magic — followed it with fs::read, encrypted whatever it pointed at and repointed the entry, leaving the mode at 0o120000. The next clone got a symlink whose target was the first NUL of a ciphertext, and the plaintext of a file no pattern declared was now a blob in the object database. The history scan had the check all along and the two disagreed.

§intent_to_add: bool

Whether this is a git add -N placeholder rather than staged content.

Such an entry carries mode 100644 and the empty blob, so it reads as “stored in the clear” and --fix used to repoint it — announcing a repair that the next git commit did not make, because git still treats the path as unstaged.

Implementations§

Source§

impl Tracked

Source

pub fn is_regular_file(&self) -> bool

Whether this entry is a regular file, the only kind git filters.

A symbolic link and a submodule gitlink both hold something that is not file content, so no declaration could ever have applied to them.

Source

pub fn holds_content(&self) -> bool

Whether this entry holds content the next commit would actually store.

Trait Implementations§

Source§

impl Clone for Tracked

Source§

fn clone(&self) -> Tracked

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Tracked

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Eq for Tracked

Source§

impl PartialEq for Tracked

Source§

fn eq(&self, other: &Tracked) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Tracked

Auto Trait Implementations§

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. 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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.