diff options
author | Xinglu Chen <public@yoctocell.xyz> | 2021-09-17 10:04:49 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2021-09-18 19:37:45 +0200 |
commit | 59ee10754eddddb99e4a80b9e18aa12ed1b3d77a (patch) | |
tree | 0e5b7e9961218577b7b4f8dcf682f8fec3403cc9 /tests/git.scm | |
parent | 6597f80839142cd341cbf6cee2f34eaf4de14533 (diff) | |
download | guix-59ee10754eddddb99e4a80b9e18aa12ed1b3d77a.tar.gz |
import: Add 'generic-git' updater.
* guix/git.scm (ls-remote-refs): New procedure. * tests/git.scm ("remote-refs" "remote-refs: only tags"): New tests. * guix/import/git.scm: New file. * doc/guix.texi (Invoking guix refresh): Document it. * tests/import-git.scm: New test file. * Makefile.am (MODULES, SCM_TESTS): Register the new files. Co-authored-by: Sarah Morgensen <iskarian@mgsn.dev> Signed-off-by: Ludovic Courtès <ludo@gnu.org>
Diffstat (limited to 'tests/git.scm')
-rw-r--r-- | tests/git.scm | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/git.scm b/tests/git.scm index aa4f03ca62..d0646bbc85 100644 --- a/tests/git.scm +++ b/tests/git.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2019, 2020 Ludovic Courtès <ludo@gnu.org> +;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz ;;; ;;; This file is part of GNU Guix. ;;; @@ -161,4 +162,31 @@ (commit-relation master1 merge) (commit-relation merge master1)))))) +(unless (which (git-command)) (test-skip 1)) +(test-equal "remote-refs" + '("refs/heads/develop" "refs/heads/master" + "refs/tags/v1.0" "refs/tags/v1.1") + (with-temporary-git-repository directory + '((add "a.txt" "A") + (commit "First commit") + (tag "v1.0" "release-1.0") + (branch "develop") + (checkout "develop") + (add "b.txt" "B") + (commit "Second commit") + (tag "v1.1" "release-1.1")) + (remote-refs directory))) + +(unless (which (git-command)) (test-skip 1)) +(test-equal "remote-refs: only tags" + '("refs/tags/v1.0" "refs/tags/v1.1") + (with-temporary-git-repository directory + '((add "a.txt" "A") + (commit "First commit") + (tag "v1.0" "Release 1.0") + (add "b.txt" "B") + (commit "Second commit") + (tag "v1.1" "Release 1.1")) + (remote-refs directory #:tags? #t))) + (test-end "git") |