Skip to content

Commit

Permalink
make last test work to allow us to clone properly (#450)
Browse files Browse the repository at this point in the history
  • Loading branch information
Byron committed Nov 2, 2022
1 parent f5155e0 commit 3890f1a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
5 changes: 3 additions & 2 deletions git-repository/src/clone/fetch/util.rs
Expand Up @@ -42,7 +42,7 @@ pub fn replace_changed_local_config_file(repo: &mut Repository, mut config: git_
/// HEAD cannot be written by means of refspec by design, so we have to do it manually here. Also create the pointed-to ref
/// if we have to, as it might not have been naturally included in the ref-specs.
pub fn update_head(
repo: &Repository,
repo: &mut Repository,
remote_refs: &[git_protocol::fetch::Ref],
reflog_message: &BStr,
remote_name: &str,
Expand Down Expand Up @@ -161,7 +161,7 @@ pub fn update_head(
/// is able to match it.
/// For that we reload the remote of `remote_name` and use its ref_specs for match.
fn setup_branch_config(
repo: &Repository,
repo: &mut Repository,
branch: &FullNameRef,
branch_id: Option<&git_hash::oid>,
remote_name: &str,
Expand Down Expand Up @@ -205,6 +205,7 @@ fn setup_branch_config(
Some(branch.as_bstr()),
);
std::fs::write(config_path, config.to_bstring())?;
replace_changed_local_config_file(repo, config);
}
Ok(())
}
4 changes: 1 addition & 3 deletions git-repository/tests/clone/mod.rs
Expand Up @@ -11,7 +11,6 @@ mod blocking_io {
use crate::remote;

#[test]
#[ignore]
fn fetch_only_with_configuration() -> crate::Result {
let tmp = git_testtools::tempfile::TempDir::new()?;
let called_configure_remote = std::sync::Arc::new(std::sync::atomic::AtomicBool::default());
Expand Down Expand Up @@ -145,8 +144,7 @@ mod blocking_io {
);
assert_eq!(
repo.branch_remote_ref(short_name.as_ref()).expect("present")?.as_bstr(),
remote_name,
"the remote branch information is fully configured"
"refs/heads/main"
);

{
Expand Down

0 comments on commit 3890f1a

Please sign in to comment.