X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-gui%2Flib%2Findex.tcl;h=e38b647b71ea335d6771121cfd079de919ced55b;hb=357ba5cf0d4c77c6b4ad8d2cc604392687a3e2a6;hp=5d7bbf23eddeb2ff146487b28a79feee1d296289;hpb=5a6d82d0865a616bf22b9bbc3baea1ad4bd4b21b;p=git.git diff --git a/git-gui/lib/index.tcl b/git-gui/lib/index.tcl index 5d7bbf23e..8efbbdde2 100644 --- a/git-gui/lib/index.tcl +++ b/git-gui/lib/index.tcl @@ -356,12 +356,33 @@ proc do_add_all {} { global file_states set paths [list] + set untracked_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 untracked_paths $path} + } + } + if {[llength $untracked_paths]} { + set reply 0 + switch -- [get_config gui.stageuntracked] { + no { + set reply 0 + } + yes { + set reply 1 + } + ask - + default { + set reply [ask_popup [mc "Stage %d untracked files?" \ + [llength $untracked_paths]]] + } + } + if {$reply} { + set paths [concat $paths $untracked_paths] } } add_helper {Adding all changed files} $paths