Skip to content

Commit

Permalink
git-gui: Don't allow merges in the middle of other things.
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Shawn O. Pearce committed Jan 26, 2007
1 parent dff7e88 commit 5f39dbf
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions git-gui.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2629,6 +2629,9 @@ The rescan will be automatically started now.

foreach path [array names file_states] {
switch -glob -- [lindex $file_states($path) 0] {
_O {
continue; # and pray it works!
}
U? {
error_popup "You are in the middle of a conflicted merge.
Expand All @@ -2637,6 +2640,18 @@ File [short_path $path] has merge conflicts.
You must resolve them, add the file, and commit to
complete the current merge. Only then can you
begin another merge.
"
unlock_index
return 0
}
?? {
error_popup "You are in the middle of a change.
File [short_path $path] is modified.
You should complete the current commit before
starting a merge. Doing so will help you abort
a failed merge, should the need arise.
"
unlock_index
return 0
Expand Down

0 comments on commit 5f39dbf

Please sign in to comment.