From 00f48f852e2cadadc0bd018323d9590db45e55da Mon Sep 17 00:00:00 2001 From: David Aguilar Date: Thu, 19 Nov 2009 01:38:38 -0800 Subject: [PATCH] commands: Fix a bug in the amend interaction If we had diffed a staged file then cola wouldn't allow the amend checkbox to take effect. This was fixed by restricting the cases where the Diff command is allowed to change modes. Signed-off-by: David Aguilar --- cola/commands.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cola/commands.py b/cola/commands.py index fe2e7113..677a546d 100644 --- a/cola/commands.py +++ b/cola/commands.py @@ -347,7 +347,8 @@ class Diff(Command): self.new_filename = filenames[0] self.old_filename = self.model.filename if not self.model.read_only(): - self.new_mode = self.model.mode_worktree + if self.model.mode != self.model.mode_amend: + self.new_mode = self.model.mode_worktree self.new_diff_text = gitcmds.diff_helper(filename=self.new_filename, cached=cached, **opts) -- 2.11.4.GIT