[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
04/10: git-download: 'git-predicate' now ignores deleted files.
From: |
guix-commits |
Subject: |
04/10: git-download: 'git-predicate' now ignores deleted files. |
Date: |
Fri, 28 May 2021 05:36:58 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit 50d5bb1f3e3f080212436db1b8666d061a8ae1d2
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Fri May 28 11:02:07 2021 +0200
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>
---
guix/git-download.scm | 12 +++++++-----
1 file changed, 7 insertions(+), 5 deletions(-)
diff --git a/guix/git-download.scm b/guix/git-download.scm
index 199effe..72084a2 100644
--- a/guix/git-download.scm
+++ b/guix/git-download.scm
@@ -231,11 +231,13 @@ absolute file name and STAT is the result of 'lstat'."
(lambda ()
(let* ((files (git-file-list directory))
(inodes (fold (lambda (file result)
- (let ((stat
- (lstat (string-append directory "/"
- file))))
- (vhash-consv (stat:ino stat) (stat:dev stat)
- result)))
+ (let* ((file (string-append directory "/" file))
+ (stat (false-if-exception (lstat file))))
+ ;; Ignore FILE if it has been deleted.
+ (if stat
+ (vhash-consv (stat:ino stat) (stat:dev stat)
+ result)
+ result)))
vlist-null
files)))
(lambda (file stat)
- branch master updated (90e1f9c -> 416f784), guix-commits, 2021/05/28
- 01/10: gnu: intel-mpi-benchmarks: Remove top-level reference to 'openmpi'., guix-commits, 2021/05/28
- 02/10: deploy: Error out when the FILE argument is missing., guix-commits, 2021/05/28
- 03/10: scripts: Commands warn when passed zero arguments., guix-commits, 2021/05/28
- 04/10: git-download: 'git-predicate' now ignores deleted files.,
guix-commits <=
- 05/10: git-download: Support submodules in 'git-predicate'., guix-commits, 2021/05/28
- 06/10: gnu: libraft: Update to 0.10.1, guix-commits, 2021/05/28
- 07/10: import: opam: Generate license for package., guix-commits, 2021/05/28
- 08/10: gnu: tryton: Factor out custom ‘check’ phase., guix-commits, 2021/05/28
- 09/10: gnu: tryton: Use local 'inputs' instead of global '%build-inputs'., guix-commits, 2021/05/28
- 10/10: gnu: tryton: Allow disabling the test suite., guix-commits, 2021/05/28