summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Tournier <zimon.toutoune@gmail.com>2026-07-03 13:04:52 +0200
committerSimon Tournier <zimon.toutoune@gmail.com>2026-07-06 12:00:25 +0200
commit1178100657fba8f4b1ff23d7752c9d9b13c7d938 (patch)
tree63206996ca6b28e9abd3902c56ca2ab794e96dbb
parent9333f302226085e0f4458a122d8a5cf745ed8870 (diff)
tests: git: Avoid nested checks for submodules.
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
-rw-r--r--tests/git.scm30
1 files changed, 15 insertions, 15 deletions
diff --git a/tests/git.scm b/tests/git.scm
index 35ddc884941..12f17d4a7b9 100644
--- a/tests/git.scm
+++ b/tests/git.scm
@@ -296,24 +296,24 @@
296 (submodule-checkout "modules/sub" ,sub-v2) 296 (submodule-checkout "modules/sub" ,sub-v2)
297 (commit "release uses submodule v2") 297 (commit "release uses submodule v2")
298 (checkout "primary")) 298 (checkout "primary"))
299 (let ((checkout1 commit1 relation1 299 (let* ((checkout1 commit1 relation1
300 (update-cached-checkout main 300 (update-cached-checkout main
301 #:recursive? #t 301 #:recursive? #t
302 #:cache-directory cache))) 302 #:cache-directory cache))
303 (head-cached1 (git-output "-C"
304 (in-vicinity checkout1 "modules/sub")
305 "rev-parse" "HEAD"))
306 (checkout2 commit2 relation2
307 (update-cached-checkout main
308 #:recursive? #t
309 #:ref '(branch . "release")
310 #:cache-directory cache))
311 (head-cached2 (git-output "-C"
312 (in-vicinity checkout2 "modules/sub")
313 "rev-parse" "HEAD")))
303 (and 314 (and
304 (string=? sub-v1 315 (string=? sub-v1 head-cached1)
305 (git-output "-C" 316 (string=? sub-v2 head-cached2)))))))))
306 (in-vicinity checkout1 "modules/sub")
307 "rev-parse" "HEAD"))
308 (let ((checkout2 commit2 relation2
309 (update-cached-checkout main
310 #:recursive? #t
311 #:ref '(branch . "release")
312 #:cache-directory cache)))
313 (string=? sub-v2
314 (git-output "-C"
315 (in-vicinity checkout2 "modules/sub")
316 "rev-parse" "HEAD")))))))))))
317 317
318(test-assert "update-cached-checkout, untracked files removed" 318(test-assert "update-cached-checkout, untracked files removed"
319 (call-with-temporary-directory 319 (call-with-temporary-directory