mirror of
https://github.com/Pull-Pal/pull-pal.git
synced 2024-11-12 23:37:02 -05:00
Fix github logic
* Allow multiple commits to be made back to back (worktre wasn't being set to nil after commit created) * Allow PR to be created even if title is not provided (i.e. because 'code change request' was skipped)
This commit is contained in:
parent
529b720eb6
commit
b29f544c23
11
vc/github.go
11
vc/github.go
@ -95,6 +95,9 @@ func (gc *GithubClient) OpenCodeChangeRequest(req llm.CodeChangeRequest, res llm
|
||||
// TODO handle gc.ctx canceled
|
||||
|
||||
title := req.Subject
|
||||
if title == "" {
|
||||
title = "update files"
|
||||
}
|
||||
branchName := randomBranchName()
|
||||
branchRefName := plumbing.NewBranchReferenceName(branchName)
|
||||
baseBranch := "main"
|
||||
@ -271,6 +274,12 @@ func (gc *GithubClient) FinishCommit(message string) error {
|
||||
When: time.Now(),
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
return err
|
||||
// set worktree to nil so a new commit can be started
|
||||
gc.worktree = nil
|
||||
|
||||
return nil
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user