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
This commit is contained in:
bobo 2024-01-04 16:22:08 +08:00
parent d496d6b9de
commit ae1a3bb400

View File

@ -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()