From 72ebec7303ce3679457b7c4229a767e83f278a4c Mon Sep 17 00:00:00 2001 From: "florian.jaeger" Date: Thu, 19 Dec 2024 12:04:18 +0100 Subject: [PATCH] fix: changed undo commit strategy to stop file deletion during failed submit process --- grader_labextension/services/git.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/grader_labextension/services/git.py b/grader_labextension/services/git.py index 2f9287e..ae74647 100644 --- a/grader_labextension/services/git.py +++ b/grader_labextension/services/git.py @@ -170,7 +170,7 @@ def go_to_commit(self, commit_hash): def undo_commit(self, n: int = 1) -> None: self.log.info(f"Undoing {n} commit(s)") - self._run_command(f"git reset --hard HEAD~{n}", cwd=self.path) + self._run_command(f"git reset --mixed HEAD~{n}", cwd=self.path) self._run_command(f"git gc", cwd=self.path) def revert(self, commit_hash: str):