     (insert "# Directory:  " default-directory "\n")
     (insert "# Use n and p to navigate and k to kill a hunk.  u is undo, g will refresh.\n")
     (insert "# Edit the patch as you please and press 'c' to commit.\n\n")
-    (let ((diff (shell-command-to-string "git diff")))
+    (let ((diff (shell-command-to-string (concat "git diff " arguments))))
       (if (zerop (length diff))
           (insert "## No changes. ##")
         (insert diff)


;; When git.el is loaded, hack into keymap.
(when (boundp 'git-status-mode-map)
  (define-key git-status-mode-map "s" 'gitsum))

;; Undo doesn't work in read-only buffers else.
(defun gitsum-undo ()

  (let ((inhibit-read-only t))
    (undo)))

(defun gitsum-refresh (&optional arguments)
  "Regenerate the patch based on the current state of the index."
  (interactive)
  (let ((inhibit-read-only t))
