git: remove unused parameter from GitFetch::get_default_branch

This commit is contained in:
Emily 2025-03-15 20:36:50 +00:00
parent 34f36d41e2
commit 4f6e79a22a
3 changed files with 3 additions and 6 deletions

View File

@ -222,8 +222,7 @@ fn fetch_new_remote(
with_remote_git_callbacks(ui, |cb| { with_remote_git_callbacks(ui, |cb| {
git_fetch.fetch(remote_name, &[StringPattern::everything()], cb, depth) git_fetch.fetch(remote_name, &[StringPattern::everything()], cb, depth)
})?; })?;
let default_branch = let default_branch = git_fetch.get_default_branch(remote_name)?;
with_remote_git_callbacks(ui, |cb| git_fetch.get_default_branch(remote_name, cb))?;
let import_stats = git_fetch.import_refs()?; let import_stats = git_fetch.import_refs()?;
print_git_import_stats(ui, fetch_tx.repo(), &import_stats, true)?; print_git_import_stats(ui, fetch_tx.repo(), &import_stats, true)?;
fetch_tx.finish(ui, "fetch from git remote into empty repo")?; fetch_tx.finish(ui, "fetch from git remote into empty repo")?;

View File

@ -2207,11 +2207,10 @@ impl<'a> GitFetch<'a> {
} }
/// Queries remote for the default branch name. /// Queries remote for the default branch name.
#[tracing::instrument(skip(self, _callbacks))] #[tracing::instrument(skip(self))]
pub fn get_default_branch( pub fn get_default_branch(
&self, &self,
remote_name: &RemoteName, remote_name: &RemoteName,
_callbacks: RemoteCallbacks<'_>,
) -> Result<Option<RefNameBuf>, GitFetchError> { ) -> Result<Option<RefNameBuf>, GitFetchError> {
if self if self
.git_repo .git_repo

View File

@ -148,8 +148,7 @@ fn git_fetch(
git::RemoteCallbacks::default(), git::RemoteCallbacks::default(),
None, None,
)?; )?;
let default_branch = let default_branch = git_fetch.get_default_branch(remote_name)?;
git_fetch.get_default_branch(remote_name, git::RemoteCallbacks::default())?;
let import_stats = git_fetch.import_refs().unwrap(); let import_stats = git_fetch.import_refs().unwrap();
let stats = GitFetchStats { let stats = GitFetchStats {