Skip to content

fix: filter source control commits by branch#286

Open
chriswritescode-dev wants to merge 1 commit into
mainfrom
fix/source-control-branch-commits
Open

fix: filter source control commits by branch#286
chriswritescode-dev wants to merge 1 commit into
mainfrom
fix/source-control-branch-commits

Conversation

@chriswritescode-dev

Copy link
Copy Markdown
Owner

The commits tab in the source control dialog was showing commits from all branches (git log --all). Now it filters to the branch being viewed by passing the current branch through to the backend git log call.

The backend falls back to HEAD (instead of --all) when no branch is provided, and trims blank values to HEAD for safety.

Changes:

  • Backend GitService.getLog accepts optional branch param, uses branch?.trim() || 'HEAD' instead of --all
  • Backend route parses ?branch= query param and forwards it
  • Frontend fetchGitLog/useGitLog accept branch param in query and key
  • CommitsTab accepts branch prop and passes it through
  • SourceControlPanel passes displayBranch to CommitsTab
  • Tests added for explicit branch, blank fallback, and default HEAD

Validation:

  • pnpm lint

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.

1 participant