Skip to content

[Bug] Clink git prompt shows ".invalid" as branch name in a git repo that uses reftables #3057

@chrisant996

Description

@chrisant996

Version Information

Cmder version:  All versions.

Cmder Edition

Cmder Full (with Git)

Description of the issue

A breaking change in git has made it no longer possible to get the git branch name just by reading the HEAD file. Now it's necessary to invoke git.exe. In a git repo that uses the new reftable storage system, the HEAD file is hard-coded to say that the branch name is ".invalid". So that's what shows up in the prompt.

How to reproduce

  1. Using the latest version of git
  2. Run git init test_repo && cd test_repo
  3. Verify that git config extensions.refstorage returns reftable
  4. Observe the branch name is ".invalid" in Cmder

Additional context

I submitted #3056 with changes that should fix the problem.

Please test and verify before approving the pull request. I tested the changes with Cmder 1.3.25, but I may have missed something, or my testing might not have been sufficient for newer unreleased versions of Cmder.

Checklist

  • I have read the documentation.
  • I have searched for similar issues and found none that describe my issue.
  • I have reproduced the issue on the latest version of Cmder.
  • I am certain my issues are not related to ConEmu, Clink, or other third-party tools that Cmder uses.

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