mirror of
https://github.com/chriswritescode-dev/opencode-manager.git
synced 2026-12-05 20:34:18 +01:00
fix: filter source control commits by branch (#286)
This commit is contained in:
1 parent
8d93f2f1f9
commit
bb1df259b6
6 files changed
+67
-11
No files matched your search
@@ -5,6 +5,7 @@ import { GIT_UI_COLORS } from '@/lib/git-status-styles'
|
||||
|
||||
interface CommitsTabProps {
|
||||
repoId: number
|
||||
branch: string
|
||||
onSelectCommit?: (hash: string) => void
|
||||
}
|
||||
|
||||
@@ -28,8 +29,8 @@ function formatRelativeTime(timestamp: string): string {
|
||||
return `${diffMonths}mo ago`
|
||||
}
|
||||
|
||||
export function CommitsTab({ repoId, onSelectCommit }: CommitsTabProps) {
|
||||
const { data, isLoading, error } = useGitLog(repoId, 50)
|
||||
export function CommitsTab({ repoId, branch, onSelectCommit }: CommitsTabProps) {
|
||||
const { data, isLoading, error } = useGitLog(repoId, 50, branch)
|
||||
|
||||
if (isLoading) {
|
||||
return (
|
||||
|
||||
@@ -230,7 +230,7 @@ export function SourceControlPanel({
|
||||
/>
|
||||
)}
|
||||
{activeTab === 'commits' && currentView === 'default' && (
|
||||
<CommitsTab repoId={repoId} onSelectCommit={handleSelectCommit} />
|
||||
<CommitsTab repoId={repoId} branch={displayBranch} onSelectCommit={handleSelectCommit} />
|
||||
)}
|
||||
{activeTab === 'branches' && currentView === 'default' && (
|
||||
<BranchesTab repoId={repoId} currentBranch={displayBranch} />
|
||||
|
||||
Reference in new issue
Block a user