emacs: make 'git-status' work with separate git dirs
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>
Enrico Scholz committed
Nov 22, 2012 at 16:58 UTC
f7d8e3d01f46ecfa5b4bc8c13640831d97a78236
1 file changed
+1
-1
contrib/emacs/git.el
+1
-1
@@ -1671,7 +1671,7 @@ Commands:
1671
"Entry point into git-status mode."
1672
(interactive "DSelect directory: ")
1673
(setq dir (git-get-top-dir dir))
1674
- (if (file-directory-p (concat (file-name-as-directory dir) ".git"))
1674
+ (if (file-exists-p (concat (file-name-as-directory dir) ".git"))
1675
(let ((buffer (or (and git-reuse-status-buffer (git-find-status-buffer dir))
1676
(create-file-buffer (expand-file-name "*git-status*" dir)))))
1677
(switch-to-buffer buffer)