Skip to content

No files shown in Commit pane for the initial commit in SHA-256 repos #5385

@kytta

Description

@kytta

Describe the bug

I am using SHA-256 commit hashes on a repo (created with git init --object-format=sha256). In it, lazygit continues to work fine, but when I try to diff individual files of the initial commit, the window is empty.

To Reproduce

Steps to reproduce the behavior:

  1. Create a SHA-256 repo with git init --object-format=sha256

  2. Add and commit any file

  3. Go to [4] Commits > select the commit > press Enter to enter diff view

  4. No files are shown, as if the commit is empty

  5. Add and commit another file

  6. Go to [4] Commits > select the latest commit > press Enter to enter diff view

  7. Everything is fine

  8. Initial commit is still broken

Expected behavior

The committed files are shown

Screenshots

Image Image
Commit list view: diff shows file in commit pressed Enter: commit appears empty

Version info:

commit=, build date=, build source=Homebrew, version=0.60.0, os=darwin, arch=arm64, git version=2.53.0

Terminal info:

iTerm2 Build 3.6.8
zsh 5.9 (arm-apple-darwin24.2.0)

Additional context

Initial commit sha: ba741fcd02b3cd42187ee46d4bdbfed10bf8fdbb15ccf739cb9ce583aefe5cae

When pressing Enter, the following gets logged:

Mar 18 09:13:50 |DEBU| RunCommand command="git -c diff.noprefix=false diff --submodule --no-ext-diff --name-status -z --no-renames 4b825dc642cb6eb9a060e54bf8d69288fbee4904 ba741fcd02b3cd42187ee46d4bdbfed10bf8fdbb15ccf739cb9ce583aefe5cae"
Mar 18 09:13:50 |ERRO| fatal: ambiguous argument '4b825dc642cb6eb9a060e54bf8d69288fbee4904': unknown revision or path not in the working tree.
Use '--' to separate paths from revisions, like this:
'git <command> [<revision>...] -- [<file>...]'

I don't know where it takes the 4b825dc642cb6eb9a060e54bf8d69288fbee4904 from; there is no such object inside .git

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions