Skip to content

Commit

Permalink
testing: configure repos cloned with Git::clone_repo_into
Browse files Browse the repository at this point in the history
I noticed that relative timestamps were enabled in the cloned repo's smartlog. That kind of output is non-deterministic, so it can't go into snapshot tests. To fix this, invoke the same configuration that we do to initialize repositories normally.
  • Loading branch information
arxanas committed Feb 11, 2024
1 parent b3b204a commit f2fbd47
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions git-branchless-lib/src/testing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,18 @@ then you can only run tests in the main `git-branchless` and \
};

let (_stdout, _stderr) = self.run(args.as_slice())?;

// Configuration options are not inherited from the original repo, so
// set them in the cloned repo.
let new_repo = Git {
repo_path: target.repo_path.clone(),
..self.clone()
};
new_repo.init_repo_with_options(&GitInitOptions {
make_initial_commit: false,
run_branchless_init: false,
})?;

Ok(())
}

Expand Down

0 comments on commit f2fbd47

Please sign in to comment.