diff options
author | Heiko Voigt <hvoigt@hvoigt.net> | 2011-05-27 17:40:24 +0200 |
---|---|---|
committer | Pat Thoyts <patthoyts@users.sourceforge.net> | 2011-10-06 23:20:16 +0100 |
commit | 856c2d75c64b0e7cfc1a8d84ad5344e8b2354085 (patch) | |
tree | b0421fa155bf5ca20096e7ac55f6ca9d58756859 | |
parent | git-gui: drop the 'n' and 'Shift-n' bindings from the last patch. (diff) | |
download | tgif-856c2d75c64b0e7cfc1a8d84ad5344e8b2354085.tar.xz |
git-gui: deal with unknown files when pressing the "Stage Changed" button
As a shortcut the "Stage Changed" button can be used to stage all current
changes in the worktree which are not set to ignore. Previously unknown
files would be ignored. The user might want to say: "Just save everything
in my worktree". To support this workflow we now ask whether the user also
wants to stage the unknown files if there are some present.
Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
-rw-r--r-- | lib/index.tcl | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/index.tcl b/lib/index.tcl index 5d7bbf23ed..e38b647b71 100644 --- a/lib/index.tcl +++ b/lib/index.tcl @@ -356,12 +356,21 @@ proc do_add_all {} { global file_states set paths [list] + set unknown_paths [list] foreach path [array names file_states] { switch -glob -- [lindex $file_states($path) 0] { U? {continue} ?M - ?T - ?D {lappend paths $path} + ?O {lappend unknown_paths $path} + } + } + if {[llength $unknown_paths]} { + set reply [ask_popup [mc "There are unknown files do you also want +to stage those?"]] + if {$reply} { + set paths [concat $paths $unknown_paths] } } add_helper {Adding all changed files} $paths |