git-gui (Win): make "Explore Working Copy" more robust
[gitweb.git] / lib / index.tcl
index d011406462b6f2ad3c83aba90612dd1d6628f385..d33896a0ce26dd34c8024e21c71123e62832b8c0 100644 (file)
@@ -164,6 +164,7 @@ proc write_update_index {fd pathList totalCnt batch after} {
                _O -
                AM {set new A_}
                _T {set new T_}
+               _U -
                U? {
                        if {[file exists $path]} {
                                set new M_
@@ -297,11 +298,18 @@ proc add_helper {txt paths} {
        set after {}
        foreach path $paths {
                switch -glob -- [lindex $file_states($path) 0] {
+               _U -
+               U? {
+                       if {$path eq $current_diff_path} {
+                               unlock_index
+                               merge_stage_workdir $path
+                               return
+                       }
+               }
                _O -
                ?M -
                ?D -
-               ?T -
-               U? {
+               ?T {
                        lappend pathList $path
                        if {$path eq $current_diff_path} {
                                set after {reshow_diff;}