Skip to content
This repository was archived by the owner on Dec 15, 2022. It is now read-only.
This repository was archived by the owner on Dec 15, 2022. It is now read-only.

Staged changes are incorrect when amending in a single-commit repo #1303

Open
@kuychaco

Description

@kuychaco

repository.getStagedChangesSinceParentCommit() and repository.getFilePatchForPath() don't correctly handle the case when HEAD~ does not exist due to the repo having only one commit.

Ideally we redesign the way users modify their most recent commit and this problem goes away entirely.

Repro steps:

  1. Create repo with a single commit that commits file1.txt
  2. Add a new line to file1.txt and stage changes
  3. Click on file1.txt in the staged changes list to view its diff
  4. Click the amend check box

Expected: Staged changes list shows file1.txt. Diff view for file1.txt shows all lines as added
Actual: Staged changes list shows "no changes". Diff view does not update. Console shows fatal: bad revision 'HEAD~'

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions