diff options
| author | Jonas Bernoulli <jonas@bernoul.li> | 2026-03-30 13:02:52 +0200 |
|---|---|---|
| committer | Jonas Bernoulli <jonas@bernoul.li> | 2026-03-30 13:02:52 +0200 |
| commit | 89a51310bd8f8087c44f7ac5c902cc82dddbbe2a (patch) | |
| tree | 0ea21a214c0d73f757517f016bce45f14b28c411 /lisp/magit-git.el | |
| parent | 6c7d3c34b51383f32f6a7a84fb1472e4f5ab7cf2 (diff) | |
Use cond more instead of if and progn
Diffstat (limited to 'lisp/magit-git.el')
| -rw-r--r-- | lisp/magit-git.el | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/lisp/magit-git.el b/lisp/magit-git.el index fb2398f..7a52a52 100644 --- a/lisp/magit-git.el +++ b/lisp/magit-git.el @@ -1245,13 +1245,12 @@ or if no rename is detected." (y (char-after (1+ pos))) (file (buffer-substring (+ pos 3) (point)))) (forward-char) - (if (memq x '(?R ?C)) - (progn - (setq pos (point)) - (skip-chars-forward "[:print:]") - (push (list file (buffer-substring pos (point)) x y) status) - (forward-char)) - (push (list file nil x y) status))) + (cond ((memq x '(?R ?C)) + (setq pos (point)) + (skip-chars-forward "[:print:]") + (push (list file (buffer-substring pos (point)) x y) status) + (forward-char)) + ((push (list file nil x y) status)))) (setq pos (point))) status))) @@ -2252,11 +2251,11 @@ specified using `core.worktree'." (let* ((default-directory (car worktree)) (wt (and (not (magit-get-boolean "core.bare")) (magit-get "core.worktree")))) - (if (and wt (file-exists-p (expand-file-name wt))) - (progn (setf (nth 0 worktree) (expand-file-name wt)) - (setf (nth 2 worktree) (magit-rev-parse "HEAD")) - (setf (nth 3 worktree) (magit-get-current-branch))) - (setf (nth 3 worktree) t)))) + (cond ((and wt (file-exists-p (expand-file-name wt))) + (setf (nth 0 worktree) (expand-file-name wt)) + (setf (nth 2 worktree) (magit-rev-parse "HEAD")) + (setf (nth 3 worktree) (magit-get-current-branch))) + ((setf (nth 3 worktree) t))))) ((string-equal line "detached") (setf (nth 4 worktree) t)) ((string-prefix-p line "locked") |
