mirror of
https://git.in.rschanz.org/ryan77627/guix.git
synced 2024-12-24 05:18:07 -05:00
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.
This commit is contained in:
parent
5d95ac9178
commit
72357e2170
2 changed files with 4 additions and 3 deletions
|
@ -416,7 +416,9 @@ (define* (commit-difference new old #:optional (excluded '()))
|
|||
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))
|
||||
|
|
|
@ -119,8 +119,7 @@ (define-module (test-git)
|
|||
(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…
Reference in a new issue