mirror of
https://github.com/stablyai/orca.git
synced 2026-09-22 16:02:32 +00:00
* fix(worktree-watcher): surface external push -u through the git-common watch An external-shell 'git push -u' writes only the common .git/config (plus refs/remotes/<remote>/<branch>), both invisible to the git-common event filter, so the Checks panel stayed on 'No upstream configured' until the renderer safety poll. Classify the common config and remote-tracking refs as status-tier signals, poll config alongside the other primary-checkout metadata files, and keep FETCH_HEAD/reflog/ref-lock churn ignored. * fix(worktree-watcher): refresh after subsequent pushes
29 lines
1.2 KiB
TypeScript
29 lines
1.2 KiB
TypeScript
import { describe, expect, it } from 'vitest'
|
|
import { isSafeGitRefName, isSafeGitStatusUpstreamRef } from './git-status-upstream-ref'
|
|
|
|
describe('git status upstream refs', () => {
|
|
it('accepts exact remote and custom upstream namespaces', () => {
|
|
expect(isSafeGitStatusUpstreamRef('refs/remotes/team/fork/feature/nested')).toBe(true)
|
|
expect(isSafeGitStatusUpstreamRef('refs/custom/origin/main')).toBe(true)
|
|
expect(isSafeGitStatusUpstreamRef('refs/tracking/main')).toBe(true)
|
|
expect(isSafeGitStatusUpstreamRef('refs/tracked-main')).toBe(true)
|
|
})
|
|
|
|
it('recognizes local branch refs without accepting them for dynamic status polling', () => {
|
|
expect(isSafeGitRefName('refs/heads/feature/base')).toBe(true)
|
|
expect(isSafeGitStatusUpstreamRef('refs/heads/feature/base')).toBe(false)
|
|
expect(isSafeGitStatusUpstreamRef('refs/worktree/feature/base')).toBe(false)
|
|
})
|
|
|
|
it.each([
|
|
'refs/heads/main',
|
|
'/refs/remotes/origin/main',
|
|
'refs/remotes/origin/../main',
|
|
'refs/remotes/origin/main.lock',
|
|
'refs/remotes/origin/feature\\escape',
|
|
'refs/remotes/origin/@{upstream}'
|
|
])('rejects unsafe or non-remote ref %s', (ref) => {
|
|
expect(isSafeGitStatusUpstreamRef(ref)).toBe(false)
|
|
})
|
|
})
|