git-download: 'git-predicate' now ignores deleted files.
When git-predicate is used on an active worktree, some files in the index might not exist on the filesystem. Instead of failing with "No such file or directory", these should be ignored. * guix/git-download.scm (git-predicate): Wrap 'lstat' call in 'false-if-exception'. Return RESULT when STAT is #f. Co-authored-by: Andrew Whatson <whatson@gmail.com>master
parent
681af1fb78
commit
50d5bb1f3e
|
@ -231,11 +231,13 @@ absolute file name and STAT is the result of 'lstat'."
|
||||||
(lambda ()
|
(lambda ()
|
||||||
(let* ((files (git-file-list directory))
|
(let* ((files (git-file-list directory))
|
||||||
(inodes (fold (lambda (file result)
|
(inodes (fold (lambda (file result)
|
||||||
(let ((stat
|
(let* ((file (string-append directory "/" file))
|
||||||
(lstat (string-append directory "/"
|
(stat (false-if-exception (lstat file))))
|
||||||
file))))
|
;; Ignore FILE if it has been deleted.
|
||||||
(vhash-consv (stat:ino stat) (stat:dev stat)
|
(if stat
|
||||||
result)))
|
(vhash-consv (stat:ino stat) (stat:dev stat)
|
||||||
|
result)
|
||||||
|
result)))
|
||||||
vlist-null
|
vlist-null
|
||||||
files)))
|
files)))
|
||||||
(lambda (file stat)
|
(lambda (file stat)
|
||||||
|
|
Reference in New Issue