Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(git): filter out detached state from branch list #74

Merged
merged 2 commits into from
Feb 28, 2025

Conversation

tugrulates
Copy link
Member

No description provided.

@Copilot Copilot bot review requested due to automatic review settings February 28, 2025 08:37
@github-actions github-actions bot added the core label Feb 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Overview

This PR aims to fix the issue where the detached HEAD state is mistakenly included in the branch list by filtering it out.

  • Added a filter in the branch list to remove branches with a space, which is intended to filter out the detached HEAD state.
  • Updated tests to ensure that branches in a detached HEAD state are properly handled for listing and deletion.

Reviewed Changes

File Description
core/git/git.ts Added a filter to remove branch names containing spaces to exclude detached HEAD state.
core/git/git.test.ts Added tests to check branch listing and deletion behavior when in the detached HEAD state.

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

Comments suppressed due to low confidence (1)

core/git/git.ts:581

  • Filtering branch names using a check for spaces might inadvertently exclude legitimate branch names if they ever include spaces. Consider using a more targeted method to filter out the detached HEAD state or adding a comment clarifying that branch names with spaces are not supported.
.filter((x) => !x.includes(" "))
@tugrulates tugrulates merged commit 65e1c6d into main Feb 28, 2025
10 checks passed
@tugrulates tugrulates deleted the fix/git/detached branch February 28, 2025 08:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant