Skip to content

Commit

Permalink
Revert the shallow clone importer work
Browse files Browse the repository at this point in the history
It doesn't seem possible to perpetually update shallow clones to
successfully determine which new files need to be ingested.

So reverting back to the 30 minute clones for now.

Signed-off-by: Jim Crossley <[email protected]>
  • Loading branch information
jcrossley3 authored and ctron committed Sep 9, 2024
1 parent 7ea2e22 commit 8aaf905
Showing 1 changed file with 5 additions and 10 deletions.
15 changes: 5 additions & 10 deletions modules/importer/src/runner/common/walker/git.rs
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,6 @@ impl<H> GitWalker<H, (), ()>
where
H: Handler,
{
/// Create a new GitWalker for a given repo and handler. By
/// default, a "shallow clone" (depth=1) of the repo will be
/// walked.
pub fn new(source: impl Into<String>, handler: H) -> Self {
Self {
source: source.into(),
Expand All @@ -87,7 +84,7 @@ where
working_dir: (),
handler,
progress: (),
depth: 1, // shallow clone, by default
depth: 0,
}
}
}
Expand Down Expand Up @@ -198,10 +195,7 @@ where
builder.branch(branch);
}

let mut fo = Self::create_fetch_options();
if self.continuation.0.is_none() {
fo.depth(self.depth);
}
let fo = self.create_fetch_options();
builder.fetch_options(fo).clone(&self.source, path)
});

Expand All @@ -215,7 +209,7 @@ where
log::info!("Fetching updates");
let mut remote = repo.find_remote("origin")?;

let mut fo = Self::create_fetch_options();
let mut fo = self.create_fetch_options();
remote.fetch(&[] as &[&str], Some(&mut fo), None)?;
remote.disconnect()?;

Expand Down Expand Up @@ -323,7 +317,7 @@ where
Ok(Continuation(Some(commit.to_string())))
}

fn create_fetch_options<'cb>() -> FetchOptions<'cb> {
fn create_fetch_options<'cb>(&self) -> FetchOptions<'cb> {
let mut cb = RemoteCallbacks::new();
cb.transfer_progress(|progress| {
let received = progress.received_objects();
Expand Down Expand Up @@ -358,6 +352,7 @@ where

let mut fo = FetchOptions::new();
fo.remote_callbacks(cb);
fo.depth(self.depth);
fo
}

Expand Down

0 comments on commit 8aaf905

Please sign in to comment.