summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--doc/guix.texi2
-rw-r--r--guix/store.scm2
-rw-r--r--tests/store.scm5
3 files changed, 4 insertions, 5 deletions
diff --git a/doc/guix.texi b/doc/guix.texi
index 5b91bc2982..5d1b780144 100644
--- a/doc/guix.texi
+++ b/doc/guix.texi
@@ -1061,7 +1061,7 @@ argument.
 Return @code{#t} when @var{path} is a valid store path.
 @end deffn
 
-@deffn {Scheme Procedure} add-text-to-store @var{server} @var{name} @var{text} @var{references}
+@deffn {Scheme Procedure} add-text-to-store @var{server} @var{name} @var{text} [@var{references}]
 Add @var{text} under file @var{name} in the store, and return its store
 path.  @var{references} is the list of store paths referred to by the
 resulting store path.
diff --git a/guix/store.scm b/guix/store.scm
index 541c7c848f..0f1e2f9466 100644
--- a/guix/store.scm
+++ b/guix/store.scm
@@ -452,7 +452,7 @@ encoding conversion errors."
                                        (string-list references))
                     #f
                     store-path)))
-    (lambda (server name text references)
+    (lambda* (server name text #:optional (references '()))
       "Add TEXT under file NAME in the store, and return its store path.
 REFERENCES is the list of store paths referred to by the resulting store
 path."
diff --git a/tests/store.scm b/tests/store.scm
index 9625a6b308..0280713191 100644
--- a/tests/store.scm
+++ b/tests/store.scm
@@ -68,8 +68,7 @@
 (test-skip (if %store 0 10))
 
 (test-assert "dead-paths"
-  (let ((p (add-text-to-store %store "random-text"
-                              (random-text) '())))
+  (let ((p (add-text-to-store %store "random-text" (random-text))))
     (member p (dead-paths %store))))
 
 ;; FIXME: Find a test for `live-paths'.
@@ -99,7 +98,7 @@
 
 (test-assert "references"
   (let* ((t1 (add-text-to-store %store "random1"
-                                (random-text) '()))
+                                (random-text)))
          (t2 (add-text-to-store %store "random2"
                                 (random-text) (list t1))))
     (and (equal? (list t1) (references %store t2))