From ae1a3bb400e41f81ac0b0f19b43d04c430a5b9dd Mon Sep 17 00:00:00 2001 From: bobo Date: Thu, 4 Jan 2024 16:22:08 +0800 Subject: [PATCH] fix: Prevent empty file list in commit prompt - Ensure the commit prompt correctly handles when no files are staged - Clean up excessive whitespace in code for readability - Simplify the creation of the Form object by removing unnecessary newlines --- commit/commit.py | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/commit/commit.py b/commit/commit.py index 0b830a8..77f6339 100644 --- a/commit/commit.py +++ b/commit/commit.py @@ -164,14 +164,12 @@ def get_marked_files(modified_files, staged_files): if len(staged_files) > 0: form_list.append("Staged:\n\n") form_list.append(staged_checkbox) - + if len(unstaged_files) > 0: form_list.append("Unstaged:\n\n") form_list.append(unstaged_checkbox) - form = Form( - form_list - ) + form = Form(form_list) # Render the Form and get user input form.render()