Skip to content

repo.commit doesn't work for tag starting with @ #2135

Description

@linsui

It fails with TypeError: HEAD is a detached symbolic reference as it points to.

Activity

  1. Byron commented on Apr 28, 2026

    @Byron
    Member

    Can you elaborate?

    It would be good to see some code that will reproduce it. Thank you.

  2. linsui commented on Apr 29, 2026

    @linsui
    Author

    I want to get the commit of a tag with

    repo = git.Repo('.')
    commit = repo.commit(tag).hexsha

    When the tag is something like @standardnotes/mobile@3.58.252 this fails with TypeError: HEAD is a detached symbolic reference as it points to error.

    It seems you have fix this? Thanks for your quick fix!

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

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