Skip to content

Commit 17fdd01

Browse files
committed
tests: make sure git commands are run in temp repository
1 parent e35fe65 commit 17fdd01

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

tests/magit-tests.el

+4-2
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,14 @@
1111

1212
(defmacro with-temp-git-repo (repo &rest body)
1313
(declare (indent 1) (debug t))
14-
`(let ((,repo (make-temp-file "tmp_git" t)))
14+
`(let* ((,repo (make-temp-file "tmp_git" t))
15+
(default-directory (concat ,repo "/")))
1516
(unwind-protect
1617
(progn
1718
(magit-init repo)
1819
,@body)
19-
(delete-directory ,repo t))))
20+
(delete-directory ,repo t)
21+
)))
2022

2123
(defun magit-tests-section-has-item-title (title &optional section-path)
2224
(let ((children (magit-section-children

0 commit comments

Comments
 (0)