@matheusbsbs / matheus-bagliano / commits / 617ceee653
Fork 0

git-gui: Don't allow staging files with conflicts.

Prevent staging files with conflict markers by clicking on the icon in the 'Unstaged Changes' list. Instead, pretend that the user clicked the name, and show the diff. Originally it made some sense to allow staging conflicting files, because git-gui did not provide any tools to resolve them from within the GUI. But now that we have added mergetool capabilities, it is more likely to cause accidental and non-undoable errors. Signed-off-by: Alexander Gavrilov <angavrilov@gmail.com> Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

Alexander Gavrilov committed Aug 31, 2008 at 00:54 UTC 617ceee653bd7377f662bfc6d3085f321efab7e4
1 file changed +8
git-gui.sh
+8
@@ -1840,6 +1840,14 @@ proc toggle_or_diff {w x y} {
1840 $ui_index tag remove in_sel 0.0 end
1841 $ui_workdir tag remove in_sel 0.0 end
1842
1843 + # Do not stage files with conflicts
1844 + if {[info exists file_states($path)]} {
1845 + set state [lindex $file_states($path) 0]
1846 + if {[string index $state 0] eq {U}} {
1847 + set col 1
1848 + }
1849 + }
1850 +
1851 if {$col == 0 && $y > 1} {
1852 set i [expr {$lno-1}]
1853 set ll [expr {[llength $file_lists($w)]-1}]