Placeholder text
This commit is contained in:
@@ -220,17 +220,12 @@ func (m *Manager) reviewPrompt(ctx context.Context, task api.Task, project api.P
|
||||
return "", err
|
||||
}
|
||||
previous = prev.CommitSha
|
||||
} else {
|
||||
parent, err := git.Parent(project.RepoPath, snap.CommitSha)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
previous = parent
|
||||
}
|
||||
changes, err := git.Compare(project.RepoPath, project.DefaultBranch, snap.CommitSha, snap.TreeSha, previous)
|
||||
if err != nil {
|
||||
return "", err
|
||||
}
|
||||
previous = changes.Base
|
||||
if len(changes.Files) == 0 {
|
||||
return "", nil
|
||||
}
|
||||
|
||||
@@ -25,10 +25,6 @@ func Changes(dir, defaultBranch, since string) (api.TaskChanges, error) {
|
||||
return Compare(dir, defaultBranch, "HEAD", tree, since)
|
||||
}
|
||||
|
||||
func Parent(dir, commit string) (string, error) {
|
||||
return run(dir, "rev-parse", "--verify", commit+"^")
|
||||
}
|
||||
|
||||
func Compare(dir, defaultBranch, head, tree, since string) (api.TaskChanges, error) {
|
||||
base := since
|
||||
if base == "" {
|
||||
|
||||
@@ -86,7 +86,7 @@ func (s *Server) snapshotChanges(w http.ResponseWriter, r *http.Request, t api.T
|
||||
|
||||
func (s *Server) stepBase(r *http.Request, t api.Task, snap api.Snapshot) (string, error) {
|
||||
if snap.N == 1 {
|
||||
return git.Parent(t.WorktreePath, snap.CommitSha)
|
||||
return "", nil
|
||||
}
|
||||
prev, err := s.store.GetSnapshot(r.Context(), t.Id, snap.N-1)
|
||||
if err != nil {
|
||||
|
||||
Reference in New Issue
Block a user