Skip to content

Commit 7734ee2

Browse files
committed
cargo-rail: fixes to nextest integration and watch mode via bacon
1 parent 06d01d2 commit 7734ee2

File tree

3 files changed

+13
-6
lines changed

3 files changed

+13
-6
lines changed

src/commands/test.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ pub fn run_test(ctx: &WorkspaceContext, config: TestConfig) -> RailResult<()> {
2929
detect_default_base_ref(ctx.git.git())?
3030
};
3131

32-
// Analyze changes since the base ref
33-
let impact = analyzer.analyze_changes(&base_ref, "HEAD")?;
32+
// Analyze changes since the base ref (to working tree)
33+
let impact = analyzer.analyze_changes(&base_ref, None)?;
3434

3535
// Get minimal test set
3636
let test_targets = impact.minimal_test_set();

src/sync/engine.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -747,7 +747,7 @@ impl<'a> SyncEngine<'a> {
747747
let analyzer = ChangeImpact::new(self.ctx);
748748

749749
// Check if this specific crate has changes
750-
if let Some(impact) = analyzer.analyze_crate_changes(&self.config.crate_name, from, "HEAD")? {
750+
if let Some(impact) = analyzer.analyze_crate_changes(&self.config.crate_name, from, Some("HEAD"))? {
751751
// Filter out commits from remote
752752
let crate_path = &self.config.crate_paths[0];
753753
let new_commits = self

src/workspace/change_analyzer.rs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,9 +119,11 @@ impl<'a> ChangeImpact<'a> {
119119
}
120120

121121
/// Analyze changes between two git refs with full graph awareness
122-
pub fn analyze_changes(&self, from: &str, to: &str) -> RailResult<ImpactReport> {
122+
///
123+
/// If `to` is None, compares against the working tree (uncommitted changes).
124+
pub fn analyze_changes(&self, from: &str, to: Option<&str>) -> RailResult<ImpactReport> {
123125
// 1. Get changed files from git
124-
let changed_files = self.ctx.git.git().get_changed_files_between(from, Some(to))?;
126+
let changed_files = self.ctx.git.git().get_changed_files_between(from, to)?;
125127

126128
// 2. Categorize changes by file type using new classification system
127129
let categories = self.categorize_changes(&changed_files);
@@ -152,7 +154,12 @@ impl<'a> ChangeImpact<'a> {
152154
}
153155

154156
/// Analyze changes for a specific crate only
155-
pub fn analyze_crate_changes(&self, crate_name: &str, from: &str, to: &str) -> RailResult<Option<ImpactReport>> {
157+
pub fn analyze_crate_changes(
158+
&self,
159+
crate_name: &str,
160+
from: &str,
161+
to: Option<&str>,
162+
) -> RailResult<Option<ImpactReport>> {
156163
let full_report = self.analyze_changes(from, to)?;
157164

158165
// Filter to only this crate

0 commit comments

Comments
 (0)