Simplify codebase per audit of fd0529b

This commit is contained in:
Ian Gulliver
2026-10-23 09:56:40 -07:00
parent fd0529b949
commit 2bc462ada6
10 changed files with 101 additions and 219 deletions
+2 -6
View File
@@ -17,7 +17,7 @@ func (s *Server) GetTaskChanges(w http.ResponseWriter, r *http.Request, taskID s
return
}
step := params.Step != nil && *params.Step
step := deref(params.Step)
if params.Snapshot != nil {
if params.Since != nil {
writeError(w, http.StatusBadRequest, errors.New("since and snapshot can't be used together"))
@@ -93,11 +93,7 @@ func (s *Server) GetTaskDiff(w http.ResponseWriter, r *http.Request, taskID stri
return
}
oldPath := ""
if params.OldPath != nil {
oldPath = *params.OldPath
}
patch, err := git.FileDiff(r.Context(), t.WorktreePath, params.Base, params.Tree, params.Path, oldPath)
patch, err := git.FileDiff(r.Context(), t.WorktreePath, params.Base, params.Tree, params.Path, deref(params.OldPath))
if err != nil {
writeError(w, http.StatusInternalServerError, err)
return