Skip to content

Commit b9d8ddd

Browse files
committed
fixed discard all changes button in simple staging
1 parent 11ce02c commit b9d8ddd

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

jupyterlab_git/git.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -594,8 +594,12 @@ def reset_to_commit(self, commit_id, top_repo_path):
594594
"""
595595
Reset the current branch to a specific past commit.
596596
"""
597+
cmd = ["git", "reset", "--hard"]
598+
if commit_id:
599+
cmd.append(commit_id)
600+
597601
my_output = subprocess.check_output(
598-
["git", "reset", "--hard", commit_id], cwd=top_repo_path
602+
cmd, cwd=top_repo_path
599603
)
600604
return my_output
601605

0 commit comments

Comments
 (0)