Browse Source

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.
wip-haskell-updates-2
Ludovic Courtès 2 years ago
parent
commit
72357e2170
No known key found for this signature in database GPG Key ID: 90B11993D9AEBB5
  1. 4
      guix/git.scm
  2. 3
      tests/git.scm

4
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))

3
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"

Loading…
Cancel
Save