Simplify codebase per audit of fd0529b
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user