Repository navigation
Commit b971752
committed
Replace git clone with read-tree and checkout-index for git checkpoint restoration
- In `apps/editor/src/commands/history-command/actions/restore-checkpoint.ts`, replace the `git clone`, `git checkout`, and `.git` deletion block with a zero-clone index approach: create a temporary index file path, run `git read-tree "${git_info.commit_hash}"` and `git checkout-index -a -f` inside `folder.uri.fsPath` using `env: { ...process.env, GIT_INDEX_FILE: temp_index_path, GIT_WORK_TREE: temp_git_clone_path }`, and ensure you clean up the temporary index file in a finally block.
└── apps
└── editor
└── src
├── commands
│ └── history-command
│ ├── actions
│ │ ├── clear-all-checkpoints.ts
│ │ ├── create-temporary-checkpoint.ts
│ │ ├── delete-checkpoint-with-undo.ts
│ │ ├── restore-checkpoint.ts
│ │ ├── sync-workspace-from-dir.ts
│ │ ├── toggle-checkpoint-pin.ts
│ │ └── update-checkpoint-description.ts
│ ├── history-command.ts
│ ├── index.ts
│ └── utils
│ └── sync-directory.ts
└── features
└── checkpoints
├── actions
│ ├── create-checkpoint.ts
│ ├── delete-checkpoint.ts
│ ├── get-checkpoints.ts
│ └── index.ts
├── types
│ ├── checkpoint.ts
│ └── index.ts
└── utils
├── copy-optimised-recursively.ts
├── get-checkpoint-path.ts
├── get-incremented-description.ts
├── git-utils.ts
└── index.ts1 parent 73a2da4 commit b971752
1 file changed
Lines changed: 24 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
291 | 291 | | |
292 | 292 | | |
293 | 293 | | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
294 | 298 | | |
295 | 299 | | |
296 | 300 | | |
297 | | - | |
298 | | - | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
299 | 311 | | |
300 | 312 | | |
301 | 313 | | |
302 | | - | |
303 | | - | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
304 | 317 | | |
305 | 318 | | |
306 | 319 | | |
307 | | - | |
308 | | - | |
309 | | - | |
310 | | - | |
311 | | - | |
312 | 320 | | |
313 | 321 | | |
314 | 322 | | |
| |||
396 | 404 | | |
397 | 405 | | |
398 | 406 | | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
399 | 414 | | |
400 | 415 | | |
401 | 416 | | |
| |||
0 commit comments