Skip to content

Unstaging a file erases the draft commit message #266

Description

@cristicretu

A successful non-commit Git action clears the commit composer, including a message the user has already written.

Reproduction

  1. In Git review, stage at least two files and select the Staged layer.
  2. Open Commit and write a message.
  3. Decide one file should not be included and click that file's Unstage action.
  4. Reopen the commit composer.

The message has been erased even though no commit was made. The remaining staged files can still be committed, but the user has to rewrite the message.

Evidence

  • The Staged toolbar offers Unstage alongside the commit composer; individual files also expose Unstage.
  • run_review_action handles Stage, Unstage, Discard, Patch, and Commit together.
  • Its success callback unconditionally sets commit_open = false and calls commit_query.clear() for every successful action.

Expected behavior and regression coverage

Retain the draft through staging, unstaging, and discard operations. Clear the submitted message after a successful Commit, with any explicit draft-discard behavior handled separately.

Test a populated commit editor with two staged files: unstage one file and verify the message survives; then successfully commit and verify the submitted draft is cleared. Also cover a failed commit retaining the draft.

Validation: source-path review on main 1196d89. The reproduction above is derived from the code; no live UI reproduction or new test was run.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions