summaryrefslogtreecommitdiff
path: root/tests/git.scm
AgeCommit message (Collapse)AuthorFilesLines
2026-07-06tests: git: Avoid duplicated helper code.Simon Tournier1-56/+30
* tests/git.scm (git): New procedure. ("update-cached-checkout, tag", "update-cached-checkout, recursive submodules follow ref", "update-cached-checkout, symref tag", "update-cached-checkout, symref pull-request"): Use it. Change-Id: I85aa14e729be1efe691418e74e37d6ae1fd3e633
2026-07-06tests: git: Avoid nested checks for submodules.Simon Tournier1-15/+15
Follow up of 8d27b1158de3cc1823d33847cb722722c769a27e discussed in #9231. * tests/git.scm ("update-cached-checkout, recursive submodules follow ref"): Replace the nested 'let' by 'let*'. Merges: #9683 Change-Id: Ibd212bbd2b6fbf02f6fcae0ecb21922686b5f8bc
2026-07-02git: Update submodules after switching cached checkout.Phillip Davis1-0/+48
Previously, update-cached-checkout updated submodules before switching the cached parent checkout to the requested ref. A second recursive update could therefore update submodules according to the previously checked-out parent tree, then reset the parent to a ref whose gitlinks name different submodule commits, leaving submodule worktrees stale. * guix/git.scm (update-cached-checkout): Update submodules after switching to the requested ref. * tests/git.scm ("update-cached-checkout, recursive submodules follow ref"): New test. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Fixes: guix/guix#7741 Merges: #9231
2026-06-30tests: git: Improve Git tag check.Simon Tournier1-10/+17
Without running 'checkout' as the last Git directives to one branch that doesn't own the Git tag, the test is trivial thus poorly relevant. This change checks that 'update-cached-checkout' and that the 'cached-directory' return both the correct Git object identifier matching the upstream Git object identifier of the Git tag. * tests/git.scm ("update-cached-checkout, tag"): Switch to 'master' branch and improve the checks. Fixes: guix/guix#9340 Merges: guix/guix!9341 Change-Id: I698f94858a4247b8bdcc54758f38f3623890b6af
2026-06-25channels: Support 'symref' branch with commit specification.Simon Tournier1-0/+72
* guix/channels.scm (channel-reference): Allow 'symref' to store both branch name and specific commit. * guix/git.scm (resolve-reference, reference-available?): Adjust. (update-cached-checkout)[ref->refspecs]: Adjust. * guix/tests/git.scm (populate-git-repository): Add 'symbolic-ref' directive. * tests/git.scm (update-cached-checkout, symref tag): Check considering Git tag as symref. (update-cached-checkout, symref pull-request): Mimick Pull Request symref and check it. Fixes: guix/guix#6910 Merges: guix/guix!7085 Change-Id: I33e2974aefcc15fff24c0df8ab7d24128c7f0046
2024-07-18git: Remove untracked files from cached checkouts.Ludovic Courtès1-1/+21
Cached checkouts could end up with stale untracked files, for example because the checkout was interrupted. As a result, when this happens for the Guix checkout, users would not get substitutes for ‘guix pull’. * guix/git.scm (delete-untracked-files): New procedure. (switch-to-ref): Use it. * tests/git.scm ("update-cached-checkout, untracked files removed"): New test. Co-authored-by: Ricardo Wurmus <rekado@elephly.net> Change-Id: Iccbe644ade396ad27a037db7e0ef1c2a68ef91ce
2023-09-26tests: Assume ‘git’ is always available.Ludovic Courtès1-10/+0
* tests/channels.scm (gpg+git-available?): Check for ‘gpg-command’ only. Remove all ‘test-skip’ statements. * tests/derivations.scm: Likewise. * tests/git-authenticate.scm: Likewise. * tests/git.scm: Likewise. * tests/import-git.scm: Likewise.
2022-10-17git: 'update-cached-checkout' returns the commit ID when given a tag.Ludovic Courtès1-1/+31
Previously, starting with commit efa578ecaece67366b4b0e2266de7c2faaa4ae54, 'update-cached-checkout' would return the OID of the annotated tag the tag points to. With this change it returns the OID of the commit object in all cases. * guix/git.scm (resolve-reference): In the 'tag' case, call 'tag-target-id' and 'tag-lookup' when OID designates an annotated tag. * tests/git.scm ("update-cached-checkout, tag"): New test.
2022-02-14git: Add 'commit-descendant?'.Ludovic Courtès1-1/+51
* guix/git.scm (commit-descendant?): New procedure. * tests/git.scm ("commit-descendant?"): New test.
2021-09-18import: Add 'generic-git' updater.Xinglu Chen1-0/+28
* 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>
2020-06-09git: 'commit-difference' really excludes the ancestors of #:excluded.Ludovic Courtès1-2/+1
* 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.
2020-05-25git: Add 'commit-relation'.Ludovic Courtès1-1/+41
* guix/git.scm (commit-relation): New procedure. * tests/git.scm ("commit-relation"): New test.
2019-12-27git: 'commit-difference' takes a list of excluded commits.Ludovic Courtès1-0/+26
* guix/git.scm (commit-closure): Add 'visited' optional parameter. (commit-difference): Add 'excluded' optional parameter; pass second argument to 'commit-closure'. * tests/git.scm ("commit-difference, excluded commits"): New test.
2019-09-23git: Add 'commit-difference'.Ludovic Courtès1-0/+99
* guix/git.scm (commit-closure, commit-difference): New procedures. * guix/tests/git.scm, tests/git.scm: New files. * Makefile.am (dist_noinst_DATA): Add guix/tests/git.scm. (SCM_TESTS): Add tests/git.scm.