Skip to content

fix: show detached head in git status#756

Closed
ktwu01 wants to merge 1 commit into
MoonshotAI:mainfrom
ktwu01:codex/detached-head-git-status
Closed

fix: show detached head in git status#756
ktwu01 wants to merge 1 commit into
MoonshotAI:mainfrom
ktwu01:codex/detached-head-git-status

Conversation

@ktwu01

@ktwu01 ktwu01 commented Jun 14, 2026

Copy link
Copy Markdown

Related Issue

Resolve #566

Problem

The footer git status helper returns no status when git branch --show-current is empty. That hides repository context in detached HEAD checkouts, even though the directory is still a valid git worktree.

What changed

When the branch name is empty, git status now falls back to git rev-parse --short HEAD and displays detached@<commit>. Existing branch/status caching and dirty/ahead/behind calculations are unchanged, and the new test covers the detached HEAD path.

Checklist

  • I have read the CONTRIBUTING document.
  • I have linked a related issue, or explained the problem above.
  • I have added tests that prove my feature works.
  • Ran gen-changesets skill, or this PR needs no changeset.
  • Ran gen-docs skill, or this PR needs no doc update.

@changeset-bot

changeset-bot Bot commented Jun 14, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: ed9377e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@moonshot-ai/kimi-code Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@liruifengv

liruifengv commented Jun 15, 2026

Copy link
Copy Markdown
Collaborator

Thanks for contributing. This PR appears to be part of a batch generated by AI scanning the issue list, and we are not accepting this kind of bulk PR, so it is being closed.

@liruifengv liruifengv closed this Jun 15, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Git status should handle detached HEAD by showing the current commit

2 participants