guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

02/03: git: 'commit-difference' really excludes the ancestors of #:exclu


From: guix-commits
Subject: 02/03: git: 'commit-difference' really excludes the ancestors of #:excluded.
Date: Mon, 8 Jun 2020 18:36:52 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit 72357e2170e88f73c11ff089f87a744cee8606ec
Author: Ludovic Courtès <ludo@gnu.org>
AuthorDate: Mon Jun 8 21:39:55 2020 +0200

    git: 'commit-difference' really excludes the ancestors of #:excluded.
    
    * guix/git.scm (commit-difference): Initialize VISITED to the closure of
    OLD and EXCLUDED, as written in the docstring.
    * tests/git.scm ("commit-difference, excluded commits"): Adjust
    accordingly.
---
 guix/git.scm  | 4 +++-
 tests/git.scm | 3 +--
 2 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/guix/git.scm b/guix/git.scm
index 1671f57..0d8e617 100644
--- a/guix/git.scm
+++ b/guix/git.scm
@@ -416,7 +416,9 @@ Essentially, this computes the set difference between the 
closure of NEW and
 that of OLD."
   (let loop ((commits (list new))
              (result '())
-             (visited (commit-closure old (list->setq excluded))))
+             (visited (fold commit-closure
+                            (setq)
+                            (cons old excluded))))
     (match commits
       (()
        (reverse result))
diff --git a/tests/git.scm b/tests/git.scm
index 4a806ab..aa4f03c 100644
--- a/tests/git.scm
+++ b/tests/git.scm
@@ -119,8 +119,7 @@
                     (list commit3 commit4))
              (lset= eq? (commit-difference commit4 commit1 (list commit3))
                     (list commit4))
-             (lset= eq? (commit-difference commit4 commit1 (list commit5))
-                    (list commit2 commit3 commit4)))))))
+             (null? (commit-difference commit4 commit1 (list commit5))))))))
 
 (unless (which (git-command)) (test-skip 1))
 (test-equal "commit-relation"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]