Skip to content

Commit 2c82ee5

Browse files
committed
wip: always force create snapshot
1 parent 1ad529d commit 2c82ee5

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

packages/opencode/src/session/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1084,7 +1084,7 @@ export namespace Session {
10841084
if ((msg.info.id === input.messageID && !input.partID) || part.id === input.partID) {
10851085
// if no useful parts left in message, same as reverting whole message
10861086
const partID = remaining.some((item) => ["text", "tool"].includes(item.type)) ? input.partID : undefined
1087-
const snapshot = session.revert?.snapshot ?? (await Snapshot.create(true))
1087+
const snapshot = session.revert?.snapshot ?? (await Snapshot.create())
10881088
log.info("revert snapshot", { snapshot })
10891089
if (lastSnapshot) await Snapshot.restore(lastSnapshot.snapshot)
10901090
const next = await update(input.sessionID, (draft) => {

packages/opencode/src/snapshot/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export namespace Snapshot {
2323
})
2424
}
2525

26-
export async function create(force?: boolean) {
26+
export async function create() {
2727
log.info("creating snapshot")
2828
const app = App.info()
2929

@@ -55,7 +55,7 @@ export namespace Snapshot {
5555
log.info("added files")
5656

5757
const result =
58-
await $`git --git-dir ${git} commit ${force ? "--allow-empty" : ""} -m "snapshot" --no-gpg-sign --author="opencode <[email protected]>"`
58+
await $`git --git-dir ${git} commit --allow-empty -m "snapshot" --no-gpg-sign --author="opencode <[email protected]>"`
5959
.quiet()
6060
.cwd(app.path.cwd)
6161
.nothrow()

0 commit comments

Comments
 (0)