summary refs log tree commit diff
path: root/tests/git.scm
diff options
context:
space:
mode:
authorMarius Bakke <mbakke@fastmail.com>2020-01-03 19:41:05 +0100
committerMarius Bakke <mbakke@fastmail.com>2020-01-03 19:41:05 +0100
commit982eff9e841f3539e4ecf93669435a290bfde571 (patch)
treeb1e3f6fc85c6c35c264f091eb2fc5cff8514c230 /tests/git.scm
parent7ba6d70e4528201151195e1ed2175ee4828bdb2f (diff)
parent7158fe4ded47a599ceb8d556132ba83fcc686962 (diff)
downloadguix-982eff9e841f3539e4ecf93669435a290bfde571.tar.gz
Merge branch 'master' into staging
Diffstat (limited to 'tests/git.scm')
-rw-r--r--tests/git.scm26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/git.scm b/tests/git.scm
index 8ba10ece51..052f8a79c4 100644
--- a/tests/git.scm
+++ b/tests/git.scm
@@ -96,4 +96,30 @@
              (lset= eq? (commit-difference master4 master2)
                     (list master4 merge master3 devel1 devel2)))))))
 
+(unless (which (git-command)) (test-skip 1))
+(test-assert "commit-difference, excluded commits"
+  (with-temporary-git-repository directory
+      '((add "a.txt" "A")
+        (commit "first commit")
+        (add "b.txt" "B")
+        (commit "second commit")
+        (add "c.txt" "C")
+        (commit "third commit")
+        (add "d.txt" "D")
+        (commit "fourth commit")
+        (add "e.txt" "E")
+        (commit "fifth commit"))
+    (with-repository directory repository
+      (let ((commit1 (find-commit repository "first"))
+            (commit2 (find-commit repository "second"))
+            (commit3 (find-commit repository "third"))
+            (commit4 (find-commit repository "fourth"))
+            (commit5 (find-commit repository "fifth")))
+        (and (lset= eq? (commit-difference commit4 commit1 (list commit2))
+                    (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)))))))
+
 (test-end "git")