       (straight-vc-git--popup
         (format "Repository %S has a dirty worktree:\n\n%s"
                 local-repo
-                (string-join
-                 (mapcar (lambda (line)
-                           (concat "  " line))
-                         (split-string status "\n"))
-                 "\n"))
+                (straight--split-and-trim
+                 status 2))
         ("z" "Stash changes"
          (let ((msg (read-string "Optional stash message: ")))
            (if (string-empty-p msg)


ACTIONS later in the list take precedence over earlier ones with
regard to keybindings."
  (let ((keymap (make-sparse-keymap))
        (func nil)
        (prompt (concat prompt "\n"))
        (max-length (apply #'max (mapcar #'length (mapcar #'car actions)))))
    (unless (assoc "C-g" actions)
      (nconc actions '(("C-g" "Cancel" keyboard-quit))))
    (dolist (action actions)
      (cl-destructuring-bind (key desc func . args) action
        (when desc
          ;; I would welcome a better way to pad strings in Elisp,
          ;; because this is kind of horrifying.
          (setq prompt
                (format
                 (format "%%s\n %%%ds %%s" max-length)
                 prompt key desc)))
        (define-key keymap (kbd key)
          (lambda ()
            (interactive)

           ;; [1]: https://stackoverflow.com/q/3921409/3538165
           (format "Repository %S has a merge conflict:\n%S"
                   local-repo
                   (straight--split-and-trim
                    conflicted-files 2))
           ("a" "Abort merge"
            (straight--get-call "git" "merge" "--abort")))))))

