crates_index_diff/index/
mod.rs1use crate::Index;
2use std::str;
3
4static INDEX_GIT_URL: &str = "https://github.com/rust-lang/crates.io-index";
5static LAST_SEEN_REFNAME: &str = "refs/heads/crates-index-diff_last-seen";
6
7pub struct CloneOptions {
9 pub url: String,
11}
12
13impl Default for CloneOptions {
14 fn default() -> Self {
15 CloneOptions {
16 url: INDEX_GIT_URL.into(),
17 }
18 }
19}
20
21impl Index {
23 pub fn repository(&self) -> &gix::Repository {
25 &self.repo
26 }
27
28 pub fn repository_mut(&mut self) -> &mut gix::Repository {
30 &mut self.repo
31 }
32
33 pub fn last_seen_reference(
35 &self,
36 ) -> Result<gix::Reference<'_>, gix::reference::find::existing::Error> {
37 self.repo.find_reference(self.seen_ref_name)
38 }
39}
40
41pub mod diff;
43pub mod init;