[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[nongnu] elpa/why-this 357cfa7e1e 34/59: Ensure that temporary file crea
From: |
ELPA Syncer |
Subject: |
[nongnu] elpa/why-this 357cfa7e1e 34/59: Ensure that temporary file created by Git backend is deleted |
Date: |
Sun, 27 Nov 2022 16:02:51 -0500 (EST) |
branch: elpa/why-this
commit 357cfa7e1e462e4d0ad651b527487c5f5b1c0de3
Author: Akib Azmain Turja <akib@disroot.org>
Commit: Akib Azmain Turja <akib@disroot.org>
Ensure that temporary file created by Git backend is deleted
---
why-this.el | 27 +++++++++++++++------------
1 file changed, 15 insertions(+), 12 deletions(-)
diff --git a/why-this.el b/why-this.el
index f17bd9019a..104b4cec1b 100644
--- a/why-this.el
+++ b/why-this.el
@@ -703,17 +703,21 @@ Do CMD with ARGS."
"git rev-parse --is-inside-work-tree"))))
('line-data
(when (> (- (nth 1 args) (nth 0 args)) 0)
- (let* ((temp-file (let ((file (make-temp-file "why-this-git-"))
- (text (buffer-substring-no-properties
- (point-min) (point-max))))
- (with-temp-file file
- (insert text))
- file))
- (command (format (concat
- "git blame -L %i,%i \"%s\" --porcelain"
- " --contents \"%s\" ; echo $?")
- (nth 0 args) (1- (nth 1 args))
- (buffer-file-name) temp-file))
+ (let* ((command (let ((temp-file
+ (let ((file (make-temp-file "why-this-git-"))
+ (text (buffer-substring-no-properties
+ (point-min) (point-max))))
+ (with-temp-file file
+ (insert text))
+ file)))
+ (unwind-protect
+ (format (concat
+ "git blame -L %i,%i \"%s\""
+ " --porcelain --contents \"%s\""
+ " ; echo $?")
+ (nth 0 args) (1- (nth 1 args))
+ (buffer-file-name) temp-file)
+ (delete-file temp-file))))
(blame (butlast
(split-string (shell-command-to-string command)
"\n")))
@@ -732,7 +736,6 @@ Do CMD with ARGS."
:author why-this--git-author-name
:time (current-time)
:desc "Uncommitted changes")))))))
- (delete-file temp-file)
(setq blame (butlast blame))
(when (zerop status)
(let (commit-alist)
- [nongnu] elpa/why-this c2a21ca13d 01/59: Core implementation without any backends, (continued)
- [nongnu] elpa/why-this c2a21ca13d 01/59: Core implementation without any backends, ELPA Syncer, 2022/11/27
- [nongnu] elpa/why-this b26fca274d 21/59: Add COPYING, ELPA Syncer, 2022/11/27
- [nongnu] elpa/why-this 88ee5f9746 27/59: Add Mercurial backend, ELPA Syncer, 2022/11/27
- [nongnu] elpa/why-this 624e98bc78 23/59: Fix relative time calculation, ELPA Syncer, 2022/11/27
- [nongnu] elpa/why-this 45dc65ccb1 26/59: Fix timezone problem in Git backend, ELPA Syncer, 2022/11/27
- [nongnu] elpa/why-this 236f8fd225 09/59: Fix problem when enabled on multiple buffers, ELPA Syncer, 2022/11/27
- [nongnu] elpa/why-this dc5fc19b75 30/59: Allow changing time format, ELPA Syncer, 2022/11/27
- [nongnu] elpa/why-this b8e612d4cb 20/59: Show tooltip on hover, ELPA Syncer, 2022/11/27
- [nongnu] elpa/why-this aa15ec4fcd 29/59: Add support for minimum column of message, ELPA Syncer, 2022/11/27
- [nongnu] elpa/why-this 3e3f852835 38/59: Fix README, ELPA Syncer, 2022/11/27
- [nongnu] elpa/why-this 357cfa7e1e 34/59: Ensure that temporary file created by Git backend is deleted,
ELPA Syncer <=
- [nongnu] elpa/why-this f3d1e47b80 37/59: Fix indentation, ELPA Syncer, 2022/11/27
- [nongnu] elpa/why-this 1c8a4fbfd5 31/59: Update screenshots, ELPA Syncer, 2022/11/27
- [nongnu] elpa/why-this 37f3842f5e 32/59: Improve why-this-relative-time, ELPA Syncer, 2022/11/27
- [nongnu] elpa/why-this bc063e0b9a 16/59: Change heat map colors for matching with light theme, ELPA Syncer, 2022/11/27
- [nongnu] elpa/why-this 6631186733 18/59: Remove screenshot captions, ELPA Syncer, 2022/11/27
- [nongnu] elpa/why-this d8db9e63e0 14/59: Fix overlay moving code and a typo in global-why-this-mode, ELPA Syncer, 2022/11/27
- [nongnu] elpa/why-this 9f8c0d4e09 11/59: Fix annonating last part when heat map disabled, ELPA Syncer, 2022/11/27
- [nongnu] elpa/why-this c914584833 59/59: Use cond instead of nested if in why-this--get-face, ELPA Syncer, 2022/11/27
- [nongnu] elpa/why-this fa904a7fae 50/59: Make lines no longer than 75 characters, ELPA Syncer, 2022/11/27
- [nongnu] elpa/why-this a8d01707ce 58/59: Add .dir-locals.el, ELPA Syncer, 2022/11/27