 
 (defun straight--merge-with-upstream (upstream)
   "Merge the current branch with an UPSTREAM ref.
-If the command fails, raise an error."
-  (straight--ensure-call "git" "merge" upstream))
+If the command fails, raise an error. After this function
+returns, the working directory will perfectly reflect the state
+of UPSTREAM."
+  (straight--ensure-call "git" "merge" upstream)
+  (straight--ensure-call "git" "submodule" "update")
+  (straight--ensure-call "git" "clean" "-f"))
 
 (defun straight--update-package (recipe)
   "Attempt to update the package specified by the RECIPE.

      (user-error "No packages loaded"))
     ((zerop valid-repos)
      (unless nomsg
        (message "All %d packages have unreachable HEADS" total-repos)))
     ((= valid-repos total-repos)
      (unless nomsg
        (message "All %d packages have reachable HEADS" total-repos)))
     (t
      (unless nomsg
        (message "%d packages have reachable HEADS, %d packages do not"
                 valid-repos (- total-repos valid-repos)))))
    (= valid-repos total-repos)))


  (message "%s...done" message))

(defun straight--warn (message &rest args)
  "Display a warning from `straight'. Return nil.
The warning message is obtained by passing MESSAGE and ARGS to
`format'."
  (ignore
