Signed-off-by: Pierre Habouzit <madcoder@debian.org>
---
contrib/vim/ftplugin/gitcommit.vim | 12 ++++++++++--
1 files changed, 10 insertions(+), 2 deletions(-)
diff --git a/contrib/vim/ftplugin/gitcommit.vim b/contrib/vim/ftplugin/gitcommit.vim
index a9cb946..e958fb1 100644
--- a/contrib/vim/ftplugin/gitcommit.vim
+++ b/contrib/vim/ftplugin/gitcommit.vim
@@ -52,9 +52,17 @@ function! Git_diff_windows(vertsplit, au
rightbelow new
endif
silent! setlocal ft=diff previewwindow bufhidden=delete nobackup noswf nobuflisted nowrap buftype=nofile
- exe 'normal :r!LANG=C cd ..; git diff HEAD -- ' . list_of_files . "\n1Gdd"
- exe 'normal :r!LANG=C cd ..; git diff HEAD -- ' . list_of_files . " \| git apply --stat\no\<esc>1GddO\<esc>"
+ let gitDir = system('git rev-parse --git-dir 2>/dev/null')
+ let gitDir = substitute(gitDir, '.git\n', '', '')
+ let wd = getcwd()
+ if gitDir != ''
+ exe 'cd '.gitDir
+ endif
+ exe 'normal :r!LANG=C git diff HEAD -- ' . list_of_files . "\n1Gdd"
+ exe 'normal :r!LANG=C git diff HEAD -- ' . list_of_files . " \| git apply --stat\no\<esc>1GddO\<esc>"
+ exe 'cd '.wd
setlocal nomodifiable
+ noremap <buffer> q :bw<cr>
if a:auto
redraw!
wincmd p
--
1.4.2.3
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html| Mark Lord | 2.6.25-rc8: FTP transfer errors |
| Kamalesh Babulal | Re: 2.6.23-rc6-mm1 |
| Greg Kroah-Hartman | [PATCH 025/196] paride: Convert from class_device to device for block/paride |
| Stephen Rothwell | Announce: Linux-next (Or Andrew's dream :-)) |
git: | |
| Linus Torvalds | Re: iptables very slow after commit 784544739a25c30637397ace5489eeb6e15d7d49 |
| David Miller | Re: [GIT]: Networking |
| Gerrit Renker | [PATCH 18/37] dccp: Support for Mandatory options |
| Jarek Poplawski | [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
