summaryrefslogtreecommitdiff
path: root/tests/git.scm
diff options
context:
space:
mode:
Diffstat (limited to 'tests/git.scm')
-rw-r--r--tests/git.scm27
1 files changed, 17 insertions, 10 deletions
diff --git a/tests/git.scm b/tests/git.scm
index 712b12c7fc4..6f910070519 100644
--- a/tests/git.scm
+++ b/tests/git.scm
@@ -246,19 +246,26 @@
246 (checkout "develop") 246 (checkout "develop")
247 (add "b.txt" "B") 247 (add "b.txt" "B")
248 (commit "Second commit") 248 (commit "Second commit")
249 (tag "v1.1" "release-1.1")) 249 (tag "v1.1" "release-1.1")
250 (let ((directory commit relation 250 (checkout "master"))
251 (update-cached-checkout directory 251 (let* ((tag (let* ((pipe (open-pipe* OPEN_READ (git-command)
252 #:ref '(tag . "v1.1")
253 #:cache-directory cache))
254 (head (let* ((pipe (open-pipe* OPEN_READ (git-command)
255 "-C" directory 252 "-C" directory
256 "rev-parse" "HEAD")) 253 "rev-parse" "v1.1^{}"))
257 (str (get-string-all pipe))) 254 (str (get-string-all pipe)))
258 (close-pipe pipe) 255 (close-pipe pipe)
259 (string-trim-right str)))) 256 (string-trim-right str)))
260 ;; COMMIT should be the ID of the commit object, not that of the tag. 257 (cached-directory commit relation
261 (string=? commit head)))))) 258 (update-cached-checkout directory
259 #:ref '(tag . "v1.1")
260 #:cache-directory cache))
261 (head (let* ((pipe (open-pipe* OPEN_READ (git-command)
262 "-C" cached-directory
263 "rev-parse" "HEAD"))
264 (str (get-string-all pipe)))
265 (close-pipe pipe)
266 (string-trim-right str))))
267 (and (string=? commit head)
268 (string=? tag head)))))))
262 269
263(test-assert "update-cached-checkout, untracked files removed" 270(test-assert "update-cached-checkout, untracked files removed"
264 (call-with-temporary-directory 271 (call-with-temporary-directory