Skip to content

Commit 0228026

Browse files
committed
testing: configure repos cloned with Git::clone_repo_into
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.
1 parent d06bd3a commit 0228026

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

git-branchless-lib/src/testing.rs

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -467,6 +467,18 @@ then you can only run tests in the main `git-branchless` and \
467467
};
468468

469469
let (_stdout, _stderr) = self.run(args.as_slice())?;
470+
471+
// Configuration options are not inherited from the original repo, so
472+
// set them in the cloned repo.
473+
let new_repo = Git {
474+
repo_path: target.repo_path.clone(),
475+
..self.clone()
476+
};
477+
new_repo.init_repo_with_options(&GitInitOptions {
478+
make_initial_commit: false,
479+
run_branchless_init: false,
480+
})?;
481+
470482
Ok(())
471483
}
472484

0 commit comments

Comments
 (0)