summary refs log tree commit diff
path: root/tests/store-deduplication.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2020-12-11 15:48:02 +0100
committerLudovic Courtès <ludo@gnu.org>2020-12-15 17:32:12 +0100
commit7530e491b517497b7b8166b5ccecdc3d4cdb468d (patch)
treef228a2bcadb518ba8e948652ec41f41aafed1c51 /tests/store-deduplication.scm
parent9e6fe0e08fda67ab298ca33ef00ffbf078ce4dd9 (diff)
downloadguix-7530e491b517497b7b8166b5ccecdc3d4cdb468d.tar.gz
deduplicate: Create the '.links' directory lazily.
This avoids repeated (mkdir-p "/gnu/store/.links") calls when
deduplicating lots of files.

* guix/store/deduplication.scm (deduplicate): Remove initial call to
'mkdir-p'.  Add ENOENT case in 'link' exception handler.  Reindent.
* tests/store-deduplication.scm ("deduplicate, ENOSPC"): Check
for (<= links 4) to account for the initial 'link' call.
Diffstat (limited to 'tests/store-deduplication.scm')
-rw-r--r--tests/store-deduplication.scm2
1 files changed, 1 insertions, 1 deletions
diff --git a/tests/store-deduplication.scm b/tests/store-deduplication.scm
index 7b01acae24..b1c2d93bbd 100644
--- a/tests/store-deduplication.scm
+++ b/tests/store-deduplication.scm
@@ -95,7 +95,7 @@
          (lambda ()
            (set! link (lambda (old new)
                         (set! links (+ links 1))
-                        (if (<= links 3)
+                        (if (<= links 4)
                             (true-link old new)
                             (throw 'system-error "link" "~A" '("Whaaat?!")
                                    (list ENOSPC))))))