diff options
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/git.scm | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/tests/git.scm b/tests/git.scm index ad43435b674..9ccd04f0cdf 100644 --- a/tests/git.scm +++ b/tests/git.scm | |||
| @@ -1,5 +1,5 @@ | |||
| 1 | ;;; GNU Guix --- Functional package management for GNU | 1 | ;;; GNU Guix --- Functional package management for GNU |
| 2 | ;;; Copyright © 2019, 2020, 2022 Ludovic Courtès <ludo@gnu.org> | 2 | ;;; Copyright © 2019-2020, 2022, 2024 Ludovic Courtès <ludo@gnu.org> |
| 3 | ;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz | 3 | ;;; Copyright © 2021 Xinglu Chen <public@yoctocell.xyz |
| 4 | ;;; | 4 | ;;; |
| 5 | ;;; This file is part of GNU Guix. | 5 | ;;; This file is part of GNU Guix. |
| @@ -259,4 +259,24 @@ | |||
| 259 | ;; COMMIT should be the ID of the commit object, not that of the tag. | 259 | ;; COMMIT should be the ID of the commit object, not that of the tag. |
| 260 | (string=? commit head)))))) | 260 | (string=? commit head)))))) |
| 261 | 261 | ||
| 262 | (test-assert "update-cached-checkout, untracked files removed" | ||
| 263 | (call-with-temporary-directory | ||
| 264 | (lambda (cache) | ||
| 265 | (with-temporary-git-repository directory | ||
| 266 | '((add "a.txt" "A") | ||
| 267 | (add ".gitignore" ".~\n") | ||
| 268 | (commit "First commit")) | ||
| 269 | (let ((directory commit relation | ||
| 270 | (update-cached-checkout directory | ||
| 271 | #:ref '() | ||
| 272 | #:cache-directory cache))) | ||
| 273 | (close-port | ||
| 274 | (open-output-file (in-vicinity cache "stale-untracked-file"))) | ||
| 275 | (let ((directory2 commit2 relation2 | ||
| 276 | (update-cached-checkout directory | ||
| 277 | #:ref '() | ||
| 278 | #:cache-directory cache))) | ||
| 279 | (not (file-exists? | ||
| 280 | (in-vicinity cache "stale-untracked-file"))))))))) | ||
| 281 | |||
| 262 | (test-end "git") | 282 | (test-end "git") |
