Skip to content

Commit bc1c0e0

Browse files
Copilotjackfirth
andcommitted
Add error checking to git test system calls
Co-authored-by: jackfirth <[email protected]>
1 parent fa9473e commit bc1c0e0

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

private/file-group.rkt

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -222,14 +222,19 @@
222222
(test-case "file-group-resolve with git repository"
223223
(define test-dir (make-temporary-file "resyntax-test-git-~a" 'directory))
224224
(parameterize ([current-directory test-dir])
225-
(system "git init -q")
226-
(system "git config user.email '[email protected]'")
227-
(system "git config user.name 'Test User'")
225+
(unless (system "git init -q")
226+
(fail "git init failed"))
227+
(unless (system "git config user.email '[email protected]'")
228+
(fail "git config email failed"))
229+
(unless (system "git config user.name 'Test User'")
230+
(fail "git config name failed"))
228231
(define test-file (build-path test-dir "test.rkt"))
229232
(call-with-output-file test-file
230233
(λ (out) (displayln "#lang racket/base\n(void)" out)))
231-
(system "git add test.rkt")
232-
(system "git commit -q -m 'Initial commit'")
234+
(unless (system "git add test.rkt")
235+
(fail "git add failed"))
236+
(unless (system "git commit -q -m 'Initial commit'")
237+
(fail "git commit failed"))
233238
(call-with-output-file test-file #:exists 'append
234239
(λ (out) (displayln "(define x 1)" out)))
235240
(define group (git-repository-file-group test-dir "HEAD"))

0 commit comments

Comments
 (0)