Skip to content

Commit

Permalink
emacs: make 'git-status' work with separate git dirs
Browse files Browse the repository at this point in the history
when trying 'M-x git-status' in a submodule created with recent (1.7.5+)
git, the command fails with

| ... is not a git working tree

This is caused by creating submodules with '--separate-git-dir' but
still checking for a working tree by testing for a '.git' directory.

The patch fixes this by relaxing the existing detection a little bit.

Signed-off-by: Enrico Scholz <enrico.scholz@sigma-chemnitz.de>
Acked-by: Alexandre Julliard <julliard@winehq.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
Enrico Scholz authored and Junio C Hamano committed Nov 26, 2012
1 parent e8a1f5a commit f7d8e3d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion contrib/emacs/git.el
Original file line number Diff line number Diff line change
Expand Up @@ -1671,7 +1671,7 @@ Commands:
"Entry point into git-status mode."
(interactive "DSelect directory: ")
(setq dir (git-get-top-dir dir))
(if (file-directory-p (concat (file-name-as-directory dir) ".git"))
(if (file-exists-p (concat (file-name-as-directory dir) ".git"))
(let ((buffer (or (and git-reuse-status-buffer (git-find-status-buffer dir))
(create-file-buffer (expand-file-name "*git-status*" dir)))))
(switch-to-buffer buffer)
Expand Down

0 comments on commit f7d8e3d

Please sign in to comment.