@matheusbsbs / matheus-bagliano / commits / 5f39dbf64f
Fork 0

git-gui: Don't allow merges in the middle of other things.

If the user is in the middle of a commit they have files which are modified. These may conflict with any merge that they may want to perform, which would cause problems if the user wants to abort a bad merge as we wouldn't have a checkpoint to roll back onto. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>

Shawn O. Pearce committed Jan 26, 2007 at 04:11 UTC 5f39dbf64f5e57c6ab7b20ba8c397df1074bc30c
1 file changed +15
git-gui.sh
+15
@@ -2629,6 +2629,9 @@ The rescan will be automatically started now.
2629
2630 foreach path [array names file_states] {
2631 switch -glob -- [lindex $file_states($path) 0] {
2632 + _O {
2633 + continue; # and pray it works!
2634 + }
2635 U? {
2636 error_popup "You are in the middle of a conflicted merge.
2637
@@ -2637,6 +2640,18 @@ File [short_path $path] has merge conflicts.
2640 You must resolve them, add the file, and commit to
2641 complete the current merge. Only then can you
2642 begin another merge.
2643 +"
2644 + unlock_index
2645 + return 0
2646 + }
2647 + ?? {
2648 + error_popup "You are in the middle of a change.
2649 +
2650 +File [short_path $path] is modified.
2651 +
2652 +You should complete the current commit before
2653 +starting a merge. Doing so will help you abort
2654 +a failed merge, should the need arise.
2655 "
2656 unlock_index
2657 return 0