Skip to content

Commit

Permalink
Improvement: do not allow squashing merges
Browse files Browse the repository at this point in the history
  • Loading branch information
randy3k committed May 11, 2017
1 parent 756db8c commit 70ec1fc
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions core/interfaces/rebase.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,13 +543,13 @@ def run_async(self):

# Cannot squash first commit.
if self.interface.entries[0].short_hash == short_hash:
sublime.status_message("Unable to squash first commit.")
sublime.message_dialog("Unable to squash first commit.")
return

squash_idx, squash_entry, _ = self.get_idx_entry_and_prev(short_hash)

if self.commit_is_merge(squash_entry.long_hash):
sublime.status_message("Unable to squash a merge.")
sublime.message_dialog("Unable to squash a merge.")
return

self.squash_idx = squash_idx
Expand All @@ -568,7 +568,7 @@ def do_action(self, target_commit):
self.get_idx_entry_and_prev(self.get_short_hash(target_commit))

if self.commit_is_merge(target_entry.long_hash):
sublime.status_message("Unable to squash a merge.")
sublime.message_dialog("Unable to squash a merge.")
return

# Generate identical change templates with author/date metadata in tact.
Expand All @@ -594,6 +594,10 @@ def do_action(self, target_commit):
class GsRebaseSquashAllCommand(RewriteBase):

def run_async(self):
for entry in self.interface.entries:
if self.commit_is_merge(entry.long_hash):
sublime.message_dialog("Unable to squash a merge.")
return

# Generate identical change templates with author/date metadata
# in tact. However, set do_commit to false for all but the last change,
Expand Down

0 comments on commit 70ec1fc

Please sign in to comment.