From cbca8af52b57a920707f206a153226151678eeb4 Mon Sep 17 00:00:00 2001 From: David Aguilar Date: Sat, 4 May 2013 00:24:21 -0700 Subject: [PATCH] Revert "main.model: remove redundant function" This reverts commit 83d18826c935e03eb3cd8f16a9f669231ff0f3a0. This function is actually not redundant... it allows us to unstage while amending. Add a comment. Signed-off-by: David Aguilar --- cola/main/model.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/cola/main/model.py b/cola/main/model.py index d9f41489..647bfc02 100644 --- a/cola/main/model.py +++ b/cola/main/model.py @@ -282,6 +282,13 @@ class MainModel(Observable): self.update_file_status() return (status, output) + def unstage_all(self): + status, output = self.git.reset(self.head, '--', '.', + with_stderr=True, + with_status=True) + self.update_file_status() + return (status, output) + def stage_all(self): status, output = self.git.add(v=True, u=True, @@ -476,7 +483,7 @@ class MainModel(Observable): def unstage_paths(self, paths): if not paths: - self.reset() + self.unstage_all() return gitcmds.unstage_paths(paths, head=self.head) self.update_file_status() -- 2.11.4.GIT