Skip to content
Draft
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
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ derive_setters = "0.1.9"
dirs = "6.0.0"
dissimilar = "1.0.9"
dotenvy = "0.15.7"
dunce = "1.0.5"
fzf-wrapped = "0.1.4"
futures = "0.3.32"
gh-workflow = "0.8.1"
Expand Down
1 change: 1 addition & 0 deletions crates/forge_services/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ handlebars.workspace = true
forge_fs.workspace = true
dashmap.workspace = true
anyhow.workspace = true
dunce.workspace = true
futures.workspace = true
reqwest.workspace = true
derive_more.workspace = true
Expand Down
13 changes: 6 additions & 7 deletions crates/forge_services/src/context_engine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -219,8 +219,7 @@ impl<F: 'static + ProviderRepository + WorkspaceIndexRepository> ForgeWorkspaceS
emit(SyncProgress::Starting).await;

let (token, user_id) = self.get_workspace_credentials().await?;
let path = path
.canonicalize()
let path = dunce::canonicalize(&path)
.with_context(|| format!("Failed to resolve path: {}", path.display()))?;

// Initialize workspace (finds existing or creates new)
Expand Down Expand Up @@ -412,8 +411,7 @@ impl<F: 'static + ProviderRepository + WorkspaceIndexRepository> ForgeWorkspaceS
where
F: WorkspaceIndexRepository,
{
let canonical_path = path
.canonicalize()
let canonical_path = dunce::canonicalize(&path)
.with_context(|| format!("Failed to resolve path: {}", path.display()))?;

// Get all workspaces from remote server
Expand Down Expand Up @@ -604,7 +602,9 @@ impl<F: 'static + ProviderRepository + WorkspaceIndexRepository> ForgeWorkspaceS
match result {
Ok(content) => {
let hash = compute_hash(&content);
let absolute_path_str = absolute_path.to_string_lossy().to_string();
let absolute_path_str = dunce::simplified(&absolute_path)
.to_string_lossy()
.to_string();
yield Ok(FileNode { file_path: absolute_path_str, content, hash });
}
Err(e) => {
Expand All @@ -618,8 +618,7 @@ impl<F: 'static + ProviderRepository + WorkspaceIndexRepository> ForgeWorkspaceS

async fn _init_workspace(&self, path: PathBuf) -> Result<(bool, WorkspaceId)> {
let (token, _user_id) = self.get_workspace_credentials().await?;
let path = path
.canonicalize()
let path = dunce::canonicalize(&path)
.with_context(|| format!("Failed to resolve path: {}", path.display()))?;

// Find workspace by exact match or ancestor from remote server
Expand Down
Loading