From 21b6dd7aeec3e4bc96d7b32cd594b7818c0c4082 Mon Sep 17 00:00:00 2001 From: Eli Young Date: Fri, 20 Feb 2015 17:15:14 -0800 Subject: [PATCH] Show all untracked files in :Gstatus window Previously, if there were untracked files inside an untracked folder, :Gstatus would only show the new folder. Attempting to run a diff on the folder would pass the directory name, which would result in Vim opening a directory listing. This makes :Gstatus list all untracked files, even if they're inside untracked folders. This requires Git >=1.4, and will silently fall back to the old behavior on earlier versions. Closes #605. --- plugin/fugitive.vim | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index 8851c7e..f037b65 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -2425,13 +2425,16 @@ function! s:BufReadIndex() abort else let cd = exists('*haslocaldir') && haslocaldir() ? 'lcd ' : 'cd ' let dir = getcwd() - if fugitive#git_version() =~# '^0\|^1\.[1-7]\.' + if fugitive#git_version() =~# '^0\|^1\.[1-3]\.' let cmd = s:repo().git_command('status') + elseif fugitive#git_version() =~# '^1\.[4-7]\.' + let cmd = s:repo().git_command('status', '-u') else let cmd = s:repo().git_command( \ '-c', 'status.displayCommentPrefix=true', \ '-c', 'color.status=false', \ '-c', 'status.short=false', + \ '-c', 'status.showUntrackedFiles=all', \ 'status') endif try