Skip to content

Commit

Permalink
Merge pull request byplayer#24 from offbyone/fix-git-symlinks
Browse files Browse the repository at this point in the history
Fixed a bug where symlinked .git directories would break egg's git path
  • Loading branch information
byplayer committed Dec 8, 2011
2 parents aabd971 + 91c3ba3 commit 3f8dc4b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions egg.el
Expand Up @@ -747,8 +747,10 @@ END-RE is the regexp to match the end of a record."

(defun egg-read-git-dir ()
"call GIT to read the git directory of default-directory."
(let ((dir (egg-git-to-string "rev-parse" "--git-dir")))
(if (stringp dir)
(let* ((dotgit-parent (and (buffer-file-name) (locate-dominating-file (buffer-file-name) ".git")))
(dir (or (and dotgit-parent (concat dotgit-parent "/.git"))
(egg-git-to-string "rev-parse" "--git-dir"))))
(if (stringp dir)
(expand-file-name dir))))

(defsubst egg-read-dir-git-dir (dir)
Expand Down

0 comments on commit 3f8dc4b

Please sign in to comment.