From b29f544c23f4b389bbc7bfded602dc15e8334151 Mon Sep 17 00:00:00 2001 From: Moby von Briesen Date: Sat, 22 Apr 2023 22:54:00 -0400 Subject: [PATCH] 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) --- vc/github.go | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/vc/github.go b/vc/github.go index dd03a3b..13344c7 100644 --- a/vc/github.go +++ b/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 }