tpope/vim-fugitive — pull request #253 by misfo (2012-09-21 16:37:01+00:00)
Title: Pick sane git_dir for :Gedit from :Gstatus window

When using a :Gedit command from the :Gstatus window the git_dir was
being based on the window that was switched into in order to edit the
file. So if Fugitive switched into a window with a file from a different
Git repo (or a file with no Git repo) the :Gedit command could fail or
edit the wrong file.

Instead base the git_dir on the window from which the :Gedit command
originated.