(commitHash: string, file: string)
| 367 | }, [selectedRemote, loadCommits]) |
| 368 | |
| 369 | async function handleSelectFile(commitHash: string, file: string) { |
| 370 | setSelectedFile(file) |
| 371 | setSelectedCommit(commitHash) |
| 372 | setDiffLoading(true) |
| 373 | try { |
| 374 | const [orig, mod] = await Promise.all([ |
| 375 | gitShowFile(folderPath, file, `${commitHash}~1`).catch(() => ""), |
| 376 | gitShowFile(folderPath, file, commitHash).catch(() => ""), |
| 377 | ]) |
| 378 | setOriginalContent(orig) |
| 379 | setModifiedContent(mod) |
| 380 | } catch { |
| 381 | setOriginalContent("") |
| 382 | setModifiedContent("") |
| 383 | } finally { |
| 384 | setDiffLoading(false) |
| 385 | } |
| 386 | } |
| 387 | |
| 388 | async function handlePush() { |
| 389 | setPushing(true) |
no test coverage detected