Commit ffe93a5
Fix git diff for first commit in commit message autogen (#9291)
## Description
What: Fix AI commit message diff generation for brand-new repositories
before the first commit.
Why: `git diff HEAD` fails when HEAD does not exist yet, which prevented
commit message autogen from seeing the changes that would be committed.
How: Use the normal `git diff HEAD` path when HEAD exists. Before the
first commit, combine staged changes with unstaged edits to staged
files, then rely on the existing untracked-file synthesis for files that
have not been staged.
fixes
[APP-4264](https://linear.app/warpdotdev/issue/APP-4264/commit-message-is-not-getting-auto-generated-for-the-first-commit-in-a)
## Server API dependencies
None.
## Agent Mode
- [x] Warp Agent Mode - This PR was created via Warp's AI Agent Mode
Co-Authored-By: Oz <oz-agent@warp.dev>1 parent c0feac2 commit ffe93a5
1 file changed
Lines changed: 12 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
643 | 643 | | |
644 | 644 | | |
645 | 645 | | |
646 | | - | |
647 | | - | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
648 | 653 | | |
649 | | - | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
650 | 659 | | |
651 | | - | |
652 | 660 | | |
653 | 661 | | |
654 | 662 | | |
| |||
0 commit comments