Commit 841d412
fix(git): resolve diff/blame paths from repo root and scope CodeViewer state per session
git status returns repo-root-relative paths, but diff/blame/log commands
were running from the session CWD (which may be a subdirectory). This caused
empty diffs when the session was opened in a subdirectory of the repo.
Added getGitRoot() helper to resolve the repo root and use it as CWD for
git diff, blame, and log --follow commands.
Also fixed CodeViewer git state (gitStatus, gitDiff, etc.) being shared
across sessions in a single global Zustand store. Added bindSession() to
reset all session-scoped state when switching between sessions.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent a5e416e commit 841d412
4 files changed
Lines changed: 77 additions & 14 deletions
File tree
- src
- frontend/src
- components/CodeViewer
- stores
- utils
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
53 | 57 | | |
54 | 58 | | |
55 | 59 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
21 | 24 | | |
22 | 25 | | |
23 | 26 | | |
| |||
52 | 55 | | |
53 | 56 | | |
54 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
55 | 61 | | |
56 | 62 | | |
57 | | - | |
| 63 | + | |
| 64 | + | |
58 | 65 | | |
59 | 66 | | |
60 | 67 | | |
| |||
128 | 135 | | |
129 | 136 | | |
130 | 137 | | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
131 | 155 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
135 | 161 | | |
136 | 162 | | |
137 | 163 | | |
| |||
302 | 328 | | |
303 | 329 | | |
304 | 330 | | |
| 331 | + | |
| 332 | + | |
305 | 333 | | |
306 | 334 | | |
307 | 335 | | |
| |||
312 | 340 | | |
313 | 341 | | |
314 | 342 | | |
315 | | - | |
| 343 | + | |
316 | 344 | | |
317 | 345 | | |
318 | 346 | | |
| |||
330 | 358 | | |
331 | 359 | | |
332 | 360 | | |
333 | | - | |
| 361 | + | |
334 | 362 | | |
335 | 363 | | |
336 | 364 | | |
| |||
350 | 378 | | |
351 | 379 | | |
352 | 380 | | |
| 381 | + | |
| 382 | + | |
353 | 383 | | |
354 | 384 | | |
355 | | - | |
| 385 | + | |
356 | 386 | | |
357 | 387 | | |
358 | 388 | | |
| |||
427 | 457 | | |
428 | 458 | | |
429 | 459 | | |
| 460 | + | |
| 461 | + | |
430 | 462 | | |
431 | 463 | | |
| 464 | + | |
432 | 465 | | |
433 | 466 | | |
434 | | - | |
| 467 | + | |
435 | 468 | | |
436 | 469 | | |
437 | 470 | | |
| |||
462 | 495 | | |
463 | 496 | | |
464 | 497 | | |
| 498 | + | |
465 | 499 | | |
0 commit comments