Skip to content

Commit f7d8e3d

Browse files
enscgitster
authored andcommitted
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 <[email protected]> Acked-by: Alexandre Julliard <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e8a1f5a commit f7d8e3d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

contrib/emacs/git.el

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1671,7 +1671,7 @@ Commands:
16711671
"Entry point into git-status mode."
16721672
(interactive "DSelect directory: ")
16731673
(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"))
16751675
(let ((buffer (or (and git-reuse-status-buffer (git-find-status-buffer dir))
16761676
(create-file-buffer (expand-file-name "*git-status*" dir)))))
16771677
(switch-to-buffer buffer)

0 commit comments

Comments
 (0)