Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

Merge branch 'maint'

  • Loading branch information...
commit 5ea1d1e716f0dca6b9fc8d5d271748a4718f5858 2 parents 446e9d5 + 7683d27
@sigma sigma authored
Showing with 5 additions and 4 deletions.
  1. +3 −2 magit.el
  2. +2 −2 tests/magit-tests.el
5 magit.el
@@ -3557,7 +3557,7 @@ FULLY-QUALIFIED-NAME is non-nil."
(defun magit-init (dir)
"Initialize git repository in the DIR directory."
(interactive (list (read-directory-name "Directory for Git repository: ")))
- (let* ((dir (expand-file-name dir))
+ (let* ((dir (file-name-as-directory (expand-file-name dir)))
(topdir (magit-get-top-dir dir)))
(when (or (not topdir)
@@ -3569,7 +3569,8 @@ FULLY-QUALIFIED-NAME is non-nil."
(unless (file-directory-p dir)
(and (y-or-n-p (format "Directory %s does not exists. Create it? " dir))
(make-directory dir)))
- (magit-run* (list magit-git-executable "init" dir)))))
+ (let ((default-directory dir))
+ (magit-run* (list magit-git-executable "init"))))))
(define-derived-mode magit-status-mode magit-mode "Magit"
"Mode for looking at git status.
4 tests/magit-tests.el
@@ -60,7 +60,7 @@
(ert-deftest magit-init-test-expansion ()
(let* ((dir "~/plop")
- (exp-dir (expand-file-name dir)))
+ (exp-dir (file-name-as-directory (expand-file-name dir))))
;; make sure all steps have the expanded version of dir
((magit-get-top-dir (dir)
@@ -68,7 +68,7 @@
(file-directory-p (dir)
((:input `(,exp-dir) :output t)))
(magit-run* (args)
- ((:input `((,magit-git-executable "init" ,exp-dir))
+ ((:input `((,magit-git-executable "init"))
:output t))))
(should (magit-init dir)))))

0 comments on commit 5ea1d1e

Please sign in to comment.
Something went wrong with that request. Please try again.