crates/evaluator: add multi-branch evaluation support

Signed-off-by: NotAShelf <raf@notashelf.dev>
Change-Id: Ida40acb8d093f7d7e387913681b767276a6a6964
This commit is contained in:
raf 2026-02-02 01:24:44 +03:00
commit 00a4dc8d37
Signed by: NotAShelf
GPG key ID: 29D95B64378DB4BF
5 changed files with 62 additions and 39 deletions

View file

@ -22,7 +22,7 @@ fn test_clone_or_fetch_clones_new_repo() {
}
let url = format!("file://{}", upstream_dir.path().display());
let result = fc_evaluator::git::clone_or_fetch(&url, work_dir.path(), "test-project");
let result = fc_evaluator::git::clone_or_fetch(&url, work_dir.path(), "test-project", None);
assert!(
result.is_ok(),
@ -54,7 +54,7 @@ fn test_clone_or_fetch_fetches_existing() {
// First clone
let (_, hash1): (std::path::PathBuf, String) =
fc_evaluator::git::clone_or_fetch(&url, work_dir.path(), "test-project")
fc_evaluator::git::clone_or_fetch(&url, work_dir.path(), "test-project", None)
.expect("first clone failed");
// Make another commit upstream
@ -70,7 +70,7 @@ fn test_clone_or_fetch_fetches_existing() {
// Second fetch
let (_, hash2): (std::path::PathBuf, String) =
fc_evaluator::git::clone_or_fetch(&url, work_dir.path(), "test-project")
fc_evaluator::git::clone_or_fetch(&url, work_dir.path(), "test-project", None)
.expect("second fetch failed");
assert!(!hash1.is_empty());
@ -80,7 +80,11 @@ fn test_clone_or_fetch_fetches_existing() {
#[test]
fn test_clone_invalid_url_returns_error() {
let work_dir = TempDir::new().unwrap();
let result =
fc_evaluator::git::clone_or_fetch("file:///nonexistent/repo", work_dir.path(), "bad-proj");
let result = fc_evaluator::git::clone_or_fetch(
"file:///nonexistent/repo",
work_dir.path(),
"bad-proj",
None,
);
assert!(result.is_err());
}