diff --git a/lang/rust/src/registry.sld b/lang/rust/src/registry.sld index 2578cda..d1d38d9 100644 --- a/lang/rust/src/registry.sld +++ b/lang/rust/src/registry.sld @@ -141,8 +141,8 @@ (create-directory repo #t) (let-values (((_ _ _) (process-wait (process-run "git" (list "init" "--bare" repo))))) #f)) - (define-values (_ commit-exists _) (process-wait (process-run "git" (list "-C" repo "cat-file" "-e" refspec)))) - (unless commit-exists + (define-values (_ normal-exit exit-code) (process-wait (process-run "git" (list "-C" repo "cat-file" "-e" refspec)))) + (unless (and normal-exit (= exit-code 0)) (let-values (((_ _ _) (process-wait (process-run "git" (list "-C" repo "fetch" "--write-fetch-head" url refspec))))) #f)) (define tree (read-git-tree repo (string-append refspec ":"))) (define subdir (find-matching-cargo tree name))