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-process.el | |
| parent | 6c7d3c34b51383f32f6a7a84fb1472e4f5ab7cf2 (diff) | |
Use cond more instead of if and progn
Diffstat (limited to 'lisp/magit-process.el')
| -rw-r--r-- | lisp/magit-process.el | 39 |
1 files changed, 20 insertions, 19 deletions
diff --git a/lisp/magit-process.el b/lisp/magit-process.el index 7e9f47c..cdcea82 100644 --- a/lisp/magit-process.el +++ b/lisp/magit-process.el @@ -572,25 +572,26 @@ flattened before use." ;; On w32, git expects UTF-8 encoded input, ignore any user ;; configuration telling us otherwise (see #3250). (encode-coding-region (point-min) (point-max) 'utf-8-unix)) - (if (file-remote-p default-directory) - ;; We lack `process-file-region', so fall back to asynch + - ;; waiting in remote case. - (progn - (magit-start-git (current-buffer) args) - (while (and magit-this-process - (eq (process-status magit-this-process) 'run)) - (sleep-for 0.005))) - (run-hooks 'magit-pre-call-git-hook) - (pcase-let* ((process-environment (magit-process-environment)) - (default-process-coding-system (magit--process-coding-system)) - (flat-args (magit-process-git-arguments args t)) - (`(,process-buf . ,section) - (magit-process-setup (magit-git-executable) flat-args)) - (inhibit-read-only t)) - (magit-process-finish - (apply #'call-process-region (point-min) (point-max) - (magit-git-executable) nil process-buf nil flat-args) - process-buf nil default-directory section)))) + (cond + ((file-remote-p default-directory) + ;; We lack `process-file-region', so fall back to asynch + + ;; waiting in remote case. + (magit-start-git (current-buffer) args) + (while (and magit-this-process + (eq (process-status magit-this-process) 'run)) + (sleep-for 0.005))) + (t + (run-hooks 'magit-pre-call-git-hook) + (pcase-let* ((process-environment (magit-process-environment)) + (default-process-coding-system (magit--process-coding-system)) + (flat-args (magit-process-git-arguments args t)) + (`(,process-buf . ,section) + (magit-process-setup (magit-git-executable) flat-args)) + (inhibit-read-only t)) + (magit-process-finish + (apply #'call-process-region (point-min) (point-max) + (magit-git-executable) nil process-buf nil flat-args) + process-buf nil default-directory section))))) ;;; Asynchronous Processes |
