MCPcopy Index your code
hub / github.com/Waishnav/devspace / initializeWorkspace

Function initializeWorkspace

src/review-checkpoints.ts:53–72  ·  view source on GitHub ↗
({ workspaceId, root })

Source from the content-addressed store, hash-verified

51
52 return {
53 async initializeWorkspace({ workspaceId, root }) {
54 const refs = reviewRefs(workspaceId);
55 const state: WorkspaceReviewState = { root, ...refs };
56 states.set(workspaceId, state);
57
58 try {
59 const eligibility = await getGitEligibility(root);
60 if (!eligibility.ok || !eligibility.gitRoot) {
61 state.diagnostic = eligibility.message ?? "show_changes requires a Git workspace in this version.";
62 return;
63 }
64
65 state.gitRoot = eligibility.gitRoot;
66 const commit = await createWorkingTreeSnapshot(eligibility.gitRoot);
67 await git(eligibility.gitRoot, ["update-ref", state.openRef, commit]);
68 await git(eligibility.gitRoot, ["update-ref", state.baselineRef, commit]);
69 } catch (error) {
70 state.diagnostic = error instanceof Error ? error.message : String(error);
71 }
72 },
73
74 async reviewChanges({ workspaceId, root, since = "last_shown", markReviewed = true }) {
75 let state = states.get(workspaceId);

Callers

nothing calls this directly

Calls 4

reviewRefsFunction · 0.85
getGitEligibilityFunction · 0.85
gitFunction · 0.70

Tested by

no test coverage detected