Skip to main content

Scan

Struct Scan 

Source
pub struct Scan {
    pub exposed: Vec<Exposure>,
    pub commits: usize,
    pub blobs: usize,
    pub unreadable: usize,
    pub unresolved_refs: usize,
    pub unresolved_names: Vec<String>,
    pub refs_unavailable: bool,
    pub partial: bool,
    pub shallow: bool,
    pub notes: Vec<String>,
    pub warnings: Vec<String>,
}
Expand description

What one scan found.

Fields§

§exposed: Vec<Exposure>

Declared paths held in the clear, sorted by path.

§commits: usize

How many commits were visited.

§blobs: usize

How many distinct blobs under a declared path were inspected.

§unreadable: usize

Objects that could not be read, so could not be judged.

Separate from Scan::warnings because the count changes what the report means: a scan that skipped something has not proved anything about it, and must not be summarised as though it had.

§unresolved_refs: usize

References the walk could not start from.

Counted apart from the objects for the same reason and a sharper one: a reference store that cannot be read at all yields no tips, so the scan visits nothing and finds nothing. Measured on the build before this existed — chmod 000 .git/packed-refs and a removed loose branch left status reporting a repository with a plaintext blob in its history as clean, exit code 0. A warning on stderr is not enough: a CI gate reads the code.

§unresolved_names: Vec<String>

Names of the references the walk could not start from, capped.

The count alone reaches stdout as “1 reference(s) could not be resolved”, which tells an operator reading a CI log nothing they can act on. The names are what turn it into an instruction.

§refs_unavailable: bool

The reference store could not be enumerated at all, so nothing here covers anything.

§partial: bool

This repository fetches objects lazily, so some were never downloaded.

The twin of Scan::shallow, and it was making the same mistake: a promisor object is absent by design, and reporting it as unreadable sent the user to git fsck, which exits 0 on a partial clone and reports nothing at all.

§shallow: bool

This is a shallow clone, so history stops at the graft points.

Reported rather than treated as corruption. A shallow clone is an ordinary, healthy state — and before this was honoured, the walk queued the parents git deliberately did not fetch, failed to read them, and told the user that objects were missing and to run git fsck, which is happy with a shallow clone and would have reported nothing. The finding still stands, because a history that was never fetched genuinely cannot be vouched for; only the explanation was wrong.

§notes: Vec<String>

Things worth stating that are not findings — a reference deliberately not walked, a file under refs/ that git ignores too.

§warnings: Vec<String>

Anything worth saying once, carried out so the binary owns the messages.

Trait Implementations§

Source§

impl Debug for Scan

Source§

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

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

impl Default for Scan

Source§

fn default() -> Scan

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl Freeze for Scan

§

impl RefUnwindSafe for Scan

§

impl Send for Scan

§

impl Sync for Scan

§

impl Unpin for Scan

§

impl UnsafeUnpin for Scan

§

impl UnwindSafe for Scan

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> Same for T

Source§

type Output = T

Should always be Self
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.