From 0435d44984d06f4fada20e3d6df9b5bd2f601f16 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 30 May 2013 07:29:04 +0530 Subject: [PATCH] Fix committing with fugitive => stuck file status Fixes #482 (I hope) --- powerline/lib/vcs/git.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/powerline/lib/vcs/git.py b/powerline/lib/vcs/git.py index a7fafd66..3c32db8f 100644 --- a/powerline/lib/vcs/git.py +++ b/powerline/lib/vcs/git.py @@ -36,8 +36,12 @@ def do_status(directory, path, func): with open(gitd, 'rb') as f: raw = f.read().partition(b':')[2].strip() gitd = os.path.abspath(os.path.join(directory, raw)) - return get_file_status(directory, os.path.join(gitd, 'index'), - path, '.gitignore', func, extra_ignore_files=(os.path.join(gitd, 'info/exclude'),)) + # We need HEAD as without it using fugitive to commit causes the + # current file's status (and only the current file) to not be updated + # for some reason I cannot be bothered to figure out. + return get_file_status( + directory, os.path.join(gitd, 'index'), + path, '.gitignore', func, extra_ignore_files=tuple(os.path.join(gitd, x) for x in ('HEAD', 'info/exclude'))) return func(directory, path)