fix(desktop): inline git identity in worktree tracking test for CI

CI runners have no global git identity. The remote repo seed commit
needs inline -c user.email/user.name flags, matching the pattern
already used by ensureGitRepo.
This commit is contained in:
ethernet 2026-07-15 11:34:59 -04:00
parent 678b86df1c
commit 1d48863b85

View file

@ -271,9 +271,10 @@ test('addWorktree: base origin/main does not set up upstream tracking', async ()
const git = (...args) => execFileSync('git', args, { cwd: cloneDir }).toString().trim()
try {
// Seed the remote with a commit on main.
// Seed the remote with a commit on main. Inline identity so it works
// on CI runners with no global git config.
execFileSync('git', ['init', '-b', 'main', remoteDir])
execFileSync('git', ['-C', remoteDir, 'commit', '--allow-empty', '-m', 'root'])
execFileSync('git', ['-C', remoteDir, '-c', 'user.email=hermes@localhost', '-c', 'user.name=Hermes', 'commit', '--allow-empty', '-m', 'root'])
// Clone so origin/main exists as a remote-tracking ref.
execFileSync('git', ['clone', remoteDir, cloneDir])