From 2509641eac3946f8c98ec89597ff07d75926fee5 Mon Sep 17 00:00:00 2001 From: Daniel Hahler Date: Thu, 27 Aug 2015 22:18:56 +0200 Subject: [PATCH] Add "stash" and stash refs in repo.superglob This looks for `refs/stash` and calls `git stash list` to get all of them in case it exists. --- plugin/fugitive.vim | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index 9bfb8c7..0543582 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -404,6 +404,11 @@ function! s:repo_superglob(base) dict abort if a:base !~# '^/' let heads = ["HEAD","ORIG_HEAD","FETCH_HEAD","MERGE_HEAD"] let heads += sort(split(s:repo().git_chomp("rev-parse","--symbolic","--branches","--tags","--remotes"),"\n")) + " Add any stashes. + if filereadable(s:repo().dir('refs/stash')) + let heads += ["stash"] + let heads += sort(split(s:repo().git_chomp("stash","list","--pretty=format:%gd"),"\n")) + endif call filter(heads,'v:val[ 0 : strlen(a:base)-1 ] ==# a:base') let results += heads endif