Commite1a16b29Recorded7 Jul 2026Repositorysigil-git

Compare process-run results with eqv? instead of numeric =

Message

process-run returns the child's exit status as an integer, but on older sigil-lib versions it returned #f when the process could not be started or waited on (fork failure under process pressure, interrupted waitpid). Comparing that result with numeric = then raised type-error: =: expected number in the middle of dependency fetches, surfacing as the intermittent sigil deps install crashes tracked upstream as t-2156/t-8ba5.

sigil-lib now raises a clean io-error from process-run instead of returning #f, which fixes the root cause. Use eqv? at the five comparison sites anyway so sigil-git degrades to its documented boolean returns rather than a type error when built against any runtime that still hands back a non-number.

Changed
 src/sigil/git.sgl | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
Diff
src/sigil/git.sglmodified
@@ -153,13 +153,13 @@
153
;; Returns #t on success, #f on failure
154
(define (git-clone-bare url target-dir)
155
(let ((result (process-run "git" "clone" "--bare" "--quiet" url target-dir)))
156
(when (= result 0)
+156
(when (eqv? result 0)
157
;; git clone --bare doesn't set a fetch refspec, so subsequent
158
;; git fetch calls won't update refs/heads/*. Add it explicitly.
159
(process-run "git" "-C" target-dir
160
"config" "remote.origin.fetch"
161
"+refs/heads/*:refs/heads/*"))
162
(= result 0)))
+162
(eqv? result 0)))
163
164
;; Ensure a bare repo has a fetch refspec configured.
165
;; Older bare repos cloned before the git-clone-bare fix may be missing it.
@@ -180,7 +180,7 @@
180
(set-current-directory! repo-dir)
181
(let ((result (process-run "git" "fetch" "--all" "--prune" "--tags" "--force" "--quiet")))
182
(set-current-directory! old-dir)
183
(= result 0))))
+183
(eqv? result 0))))
184
185
;; ============================================================
186
;; WORKTREE OPERATIONS
@@ -200,7 +200,7 @@
200
(process-run "git" "fetch" "origin" ref "--quiet"))
201
(let ((result (process-run "git" "worktree" "add" "--detach" "--quiet" worktree-dir ref)))
202
(set-current-directory! old-dir)
203
(= result 0))))
+203
(eqv? result 0))))
204
205
(define (looks-like-hash? s)
206
(and (>= (string-length s) 7)
@@ -221,7 +221,7 @@
221
(set-current-directory! repo-dir)
222
(let ((result (process-run "git" "worktree" "remove" "--force" worktree-dir)))
223
(set-current-directory! old-dir)
224
(= result 0))))
+224
(eqv? result 0))))
225
226
;; List all worktrees for a repo
227
;; Returns a list of worktree paths, or #f on failure