From 19d1c944dbf59f252135688018610a12ce5718b4 Mon Sep 17 00:00:00 2001 From: Tim Pope Date: Wed, 9 Mar 2016 21:31:25 -0500 Subject: [PATCH] Remove unmerged files on :Gstatus U --- doc/fugitive.txt | 1 + plugin/fugitive.vim | 2 ++ 2 files changed, 3 insertions(+) diff --git a/doc/fugitive.txt b/doc/fugitive.txt index bd903bf..4a7b8b7 100644 --- a/doc/fugitive.txt +++ b/doc/fugitive.txt @@ -60,6 +60,7 @@ that are part of Git repositories). U |:Git| checkout U |:Git| checkout HEAD (staged files) U |:Git| clean (untracked files) + U |:Git| rm (unmerged files) *fugitive-:Gcommit* :Gcommit [args] A wrapper around git-commit. If there is nothing diff --git a/plugin/fugitive.vim b/plugin/fugitive.vim index 814e3b3..44b249a 100644 --- a/plugin/fugitive.vim +++ b/plugin/fugitive.vim @@ -864,6 +864,8 @@ function! s:StageUndo() abort if !empty(hash) if section ==# 'untracked' call repo.git_chomp_in_tree('clean', '--', filename) + elseif section ==# 'unmerged' + call repo.git_chomp_in_tree('rm', '--', filename) elseif section ==# 'unstaged' call repo.git_chomp_in_tree('checkout', '--', filename) else