(zilch lang rust registry): skip git fetch if revspec already fetched
This commit is contained in:
parent
493f6712de
commit
5721c8263b
1 changed files with 3 additions and 1 deletions
|
|
@ -127,7 +127,9 @@
|
|||
(create-directory repo #t)
|
||||
(let-values (((_ _ _) (process-wait (process-run "git" (list "init" "--bare" repo))))) #f))
|
||||
|
||||
(define-values (_ _ _) (process-wait (process-run "git" (list "-C" repo "fetch" "--write-fetch-head" url refspec))))
|
||||
(define-values (_ commit-exists _) (process-wait (process-run "git" (list "-C" repo "cat-file" "-e" refspec))))
|
||||
(unless commit-exists
|
||||
(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))
|
||||
(unless subdir (error "could not find package in git repo" (list url refspec name)))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue