stgit.el: Make single file diff buffer read-only
authorGustav Hållberg <gustav@virtutech.com>
Mon, 12 Jan 2009 20:20:13 +0000 (21:20 +0100)
committerKarl Hasselström <kha@treskal.com>
Thu, 22 Jan 2009 22:57:38 +0000 (23:57 +0100)
Signed-off-by: Gustav Hållberg <gustav@virtutech.com>
Signed-off-by: Karl Hasselström <kha@treskal.com>
contrib/stgit.el

index 9c88e60..b2ef43c 100644 (file)
@@ -713,20 +713,17 @@ With numeric prefix argument, pop that many patches."
             (unless patched-file
               (error "No patch or file at point"))
             (let ((id (stgit-id (car patched-file))))
-              (with-output-to-temp-buffer "*StGit diff*"
-                (if (consp (cdr patched-file))
-                    ;; two files (copy or rename)
-                    (stgit-run-git "diff" "-C" "-C" (concat id "^") id "--"
-                                   (cadr patched-file) (cddr patched-file))
-                  ;; just one file
-                  (stgit-run-git "diff" (concat id "^") id "--"
-                                 (cdr patched-file)))
-                (with-current-buffer standard-output
-                  (diff-mode)))))
-        (stgit-run "show" patchsym)
-        (with-current-buffer standard-output
-          (goto-char (point-min))
-          (diff-mode))))))
+             (if (consp (cdr patched-file))
+                 ;; two files (copy or rename)
+                 (stgit-run-git "diff" "-C" "-C" (concat id "^") id "--"
+                                (cadr patched-file) (cddr patched-file))
+               ;; just one file
+               (stgit-run-git "diff" (concat id "^") id "--"
+                              (cdr patched-file)))))
+        (stgit-run "show" patchsym))
+      (with-current-buffer standard-output
+       (goto-char (point-min))
+       (diff-mode)))))
 
 (defun stgit-edit ()
   "Edit the patch on the current line."