Skip to content
Merged
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
12 changes: 7 additions & 5 deletions src/services/checkpoints/ShadowCheckpointService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,9 @@ export class ShadowCheckpointService implements CheckpointService {
.map((line) => line.split(" ")[0].trim())
}
} catch (error) {
console.warn(`Failed to read .gitattributes: ${error instanceof Error ? error.message : String(error)}`)
this.log(
`[initShadowGit] failed to read .gitattributes: ${error instanceof Error ? error.message : String(error)}`,
)
}

// Add basic excludes directly in git config, while respecting any
Expand All @@ -101,7 +103,7 @@ export class ShadowCheckpointService implements CheckpointService {
try {
await this.git.add(".")
} catch (error) {
console.error(`Failed to add files to git: ${error instanceof Error ? error.message : String(error)}`)
this.log(`[stageAll] failed to add files to git: ${error instanceof Error ? error.message : String(error)}`)
} finally {
await this.renameNestedGitRepos(false)
}
Expand Down Expand Up @@ -149,7 +151,7 @@ export class ShadowCheckpointService implements CheckpointService {
try {
this.shadowGitConfigWorktree = (await this.git.getConfig("core.worktree")).value || undefined
} catch (error) {
console.error(
this.log(
`[getShadowGitConfigWorktree] failed to get core.worktree: ${error instanceof Error ? error.message : String(error)}`,
)
}
Expand All @@ -172,7 +174,7 @@ export class ShadowCheckpointService implements CheckpointService {
return undefined
}
} catch (error) {
console.error(
this.log(
`[saveCheckpoint] failed to create checkpoint: ${error instanceof Error ? error.message : String(error)}`,
)

Expand Down Expand Up @@ -209,7 +211,7 @@ export class ShadowCheckpointService implements CheckpointService {

const after = to
? await this.git.show([`${to}:${relPath}`]).catch(() => "")
: await fs.readFile(relPath, "utf8").catch(() => "")
: await fs.readFile(absPath, "utf8").catch(() => "")
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be absPath (like it is in the other checkpoints service).


result.push({ paths: { relative: relPath, absolute: absPath }, content: { before, after } })
}
Expand Down
Loading