Merge branch 'jc/checkout-auto-track'
[gitweb.git] / git-gui / lib / mergetool.tcl
index 6ab5701d937b9a719570907e745609b60d1d56a8..3fe90e697002baaa1c5fa8df4c3d3eae199b062d 100644 (file)
@@ -23,13 +23,14 @@ This operation can be undone only by restarting the merge." \
        }
 }
 
-proc merge_stage_workdir {path w lno} {
+proc merge_stage_workdir {path {lno {}}} {
        global current_diff_path diff_active
+       global current_diff_side ui_workdir
 
        if {$diff_active} return
 
-       if {$path ne $current_diff_path} {
-               show_diff $path $w $lno {} [list do_merge_stage_workdir $path]
+       if {$path ne $current_diff_path || $ui_workdir ne $current_diff_side} {
+               show_diff $path $ui_workdir $lno {} [list do_merge_stage_workdir $path]
        } else {
                do_merge_stage_workdir $path
        }
@@ -87,7 +88,7 @@ proc merge_load_stages {path cont} {
        set merge_stages(3) {}
        set merge_stages_buf {}
 
-       set merge_stages_fd [eval git_read ls-files -u -z -- $path]
+       set merge_stages_fd [eval git_read ls-files -u -z -- {$path}]
 
        fconfigure $merge_stages_fd -blocking 0 -translation binary -encoding binary
        fileevent $merge_stages_fd readable [list read_merge_stages $merge_stages_fd $cont]
@@ -375,26 +376,18 @@ proc merge_tool_finish {fd} {
                }
        }
 
-       # Check the modification time of the target file
-       if {!$failed && [file mtime $mtool_target] eq $mtool_mtime} {
-               if {[ask_popup [mc "File %s unchanged, still accept as resolved?" \
-                               [short_path $mtool_target]]] ne {yes}} {
-                       set failed 1
-               }
-       }
-
        # Finish
        if {$failed} {
                file rename -force -- $backup $mtool_target
                delete_temp_files $mtool_tmpfiles
                ui_status [mc "Merge tool failed."]
        } else {
-               if {[is_config_true merge.keepbackup]} {
+               if {[is_config_true mergetool.keepbackup]} {
                        file rename -force -- $backup "$mtool_target.orig"
                }
 
                delete_temp_files $mtool_tmpfiles
 
-               merge_add_resolution $mtool_target
+               reshow_diff
        }
 }