Don't fetch/checkout packages that are up-to-date

This commit is contained in:
Henrik Lissner 2020-01-14 22:47:38 -05:00
parent 4cc14389e8
commit dc4df47842
No known key found for this signature in database
GPG key ID: 5F6C0EA160557395

View file

@ -156,6 +156,11 @@ declaration) or dependency thereof that hasn't already been."
(let ((commit (straight-vc-get-commit type local-repo))
(newcommit (cdr (assoc (or local-repo package) versions-alist)))
fetch-p)
(when (and (stringp newcommit)
(string-match-p (concat "^" (regexp-quote newcommit)) commit))
(print! (start "\033[K(%d/%d) %s is up-to-date...\033[1A")
i total package)
(throw 'skip t))
(unless (or (and (stringp newcommit)
(straight-vc-commit-present-p recipe newcommit)
(print! (start "\033[K(%d/%d) Checking out %s (%s)...\033[1A")
@ -168,7 +173,7 @@ declaration) or dependency thereof that hasn't already been."
i total (or local-repo package))
(throw 'skip t))
(let ((output (straight--process-get-output)))
(if newcommit
(if (and (stringp newcommit) (straight-vc-commit-present-p recipe newcommit))
(straight-vc-check-out-commit recipe newcommit)
(straight-merge-package package)
(setq newcommit (straight-vc-get-commit type local-repo)))