Checkout not working as expected

1 view
Skip to first unread message

Eric Berquist

unread,
Feb 15, 2026, 11:46:39 AMFeb 15
to dulwich-discuss
I'm trying to replicate the CLI experience of `git checkout <SHA goes here>`. Using:

from dulwich import porcelain

repo = porcelain.clone(
    source="https://github.com/cclib/cclib",
    target="cclib",
)
porcelain.checkout(repo=repo, target="4557cf6d8e3eafdf76e80daa4b5de0bdc4d8ec2c")
print(porcelain.status(repo=repo, untracked_files="all"))

prints:

GitStatus(staged={'add': [], 'delete': [], 'modify': [b'.github/workflows/docs.yml', b'.github/workflows/nix.yml', b'.github/workflows/pre-commit.yml', b'.github/workflows/publish.yml', b'.github/workflows/test_and_package.yml']}, unstaged=[], untracked=[])

which is confirmed by Git:

$ git status
Not currently on any branch.
Changes to be committed:
  (use "git restore --staged <file>..." to unstage)
        modified:   .github/workflows/docs.yml
        modified:   .github/workflows/nix.yml
        modified:   .github/workflows/pre-commit.yml
        modified:   .github/workflows/publish.yml
        modified:   .github/workflows/test_and_package.yml

when the CLI experience of `git checkout 4557cf6d8e3eafdf76e80daa4b5de0bdc4d8ec2c` is:

$ git status
HEAD detached at 4557cf6d
nothing to commit, working tree clean

The head is correct, but the working tree is not what I expect. What else do I need to do?

Jelmer Vernooij

unread,
Feb 17, 2026, 12:20:25 PMFeb 17
to Eric Berquist, dulwich-discuss
Hi Eric,

It turns out this was a regression in 1.0.0. I've just released 1.1.0, which should address this.

Jelmer

--
You received this message because you are subscribed to the Google Groups "dulwich-discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to dulwich-discu...@googlegroups.com.
To view this discussion, visit https://groups.google.com/d/msgid/dulwich-discuss/9ee5d91f-7f87-4261-a9f8-d950e5f14c93n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages