Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions crates/engine/src/git_diff.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ pub fn changed_swift_files(workspace_root: &Path) -> Vec<PathBuf> {
&["diff", "--name-only", "HEAD", "--", "*.swift"],
) {
rel_paths.extend(lines.into_iter().map(PathBuf::from));
} else {
// Fallback for commit-less repositories: get staged files from the index.
if let Ok(lines) = git_lines(workspace_root, &["ls-files", "--", "*.swift"]) {
rel_paths.extend(lines.into_iter().map(PathBuf::from));
}
}

// Newly created, untracked Swift files.
Expand Down Expand Up @@ -169,4 +174,21 @@ mod tests {
let result = head_content(tmp.path(), &file);
assert!(result.is_none());
}

#[test]
fn test_changed_swift_files_in_repo_without_head_includes_staged_swift() {
let tmp = TempDir::new().unwrap();
let root = tmp.path();

git_ok(root, &["init"]);
git_ok(root, &["config", "user.email", "flowmap-test@example.com"]);
git_ok(root, &["config", "user.name", "FlowMap Test"]);

let file = root.join("StagedNew.swift");
fs::write(&file, "func stagedNew() {}\n").unwrap();
git_ok(root, &["add", "StagedNew.swift"]);

let result = changed_swift_files(root);
assert!(result.contains(&file));
}
}
20 changes: 18 additions & 2 deletions crates/engine/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -253,9 +253,25 @@ fn build_resolution_context(
}

fn is_changed_file_uri(uri: &str, changed_files: &[PathBuf]) -> bool {
let uri_path = Path::new(uri);
let uri_clean = uri.strip_prefix("file://").unwrap_or(uri);
let uri_path = Path::new(uri_clean);

changed_files.iter().any(|changed| {
uri_path == changed.as_path() || uri_path.ends_with(changed) || changed.ends_with(uri_path)
let changed_clean = changed.to_string_lossy();
let changed_clean = changed_clean
.strip_prefix("file://")
.unwrap_or(&changed_clean);
let changed_path = Path::new(changed_clean);

if uri_path == changed_path {
return true;
}

match (uri_path.is_absolute(), changed_path.is_absolute()) {
(true, false) => uri_path.ends_with(changed_path),
(false, true) => changed_path.ends_with(uri_path),
_ => false,
}
})
}

Expand Down
5 changes: 5 additions & 0 deletions docs/releases/v0.1.0-beta.1.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,11 @@ Validation artifacts:
GitHub Actions minutes were exhausted during this cycle.
This release was validated with local reproducible checks and pushed directly without full PR checks.

## Artifact Checksum

- `flowmap-0.1.0-public-beta.vsix`
SHA-256: `6597807d2693a8a14abb6eb266a72e943b0561c9ca10be75005663117ef6ed13`

## License (Beta)

Final licensing terms will be announced after the beta period.
Expand Down
Loading
Loading