Skip to content

Commit

Permalink
Fix vcs context.
Browse files Browse the repository at this point in the history
  • Loading branch information
milesj committed Nov 13, 2024
1 parent 53f8da2 commit a46202c
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions crates/workspace/src/workspace_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,11 +191,19 @@ impl<'app> WorkspaceBuilder<'app> {
..Default::default()
};

// This is only in a conditional for tests!
// These are only in conditionals for tests that don't have git
// initialized, which is most of them!
if let Some(vcs) = &context.vcs {
graph_context.vcs_branch = vcs.get_local_branch().await?;
graph_context.vcs_repository = vcs.get_repository_slug().await?;
graph_context.vcs_revision = vcs.get_local_branch_revision().await?;
if vcs.is_enabled() {
graph_context.vcs_branch = vcs.get_local_branch().await?;
graph_context.vcs_revision = vcs.get_local_branch_revision().await?;

if let Ok(repo) = vcs.get_repository_slug().await {
graph_context.vcs_repository = repo;
}
} else {
graph_context.vcs_branch = vcs.get_default_branch().await?;
}
}

let project_metadata = self
Expand Down

0 comments on commit a46202c

Please sign in to comment.