chore: import upstream snapshot with attribution
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import { expect } from 'vitest'
|
||||
|
||||
import { sandboxTest } from '../../setup.js'
|
||||
import { cleanupBaseDir, createBaseDir } from './helpers.js'
|
||||
|
||||
sandboxTest('git init', async ({ sandbox }) => {
|
||||
const baseDir = await createBaseDir(sandbox)
|
||||
|
||||
try {
|
||||
const repoPath = `${baseDir}/repo`
|
||||
|
||||
await sandbox.git.init(repoPath, { initialBranch: 'main' })
|
||||
|
||||
expect(await sandbox.files.exists(`${repoPath}/.git`)).toBe(true)
|
||||
const head = (
|
||||
await sandbox.commands.run(
|
||||
`git -C "${repoPath}" symbolic-ref --short HEAD`
|
||||
)
|
||||
).stdout.trim()
|
||||
expect(head).toBe('main')
|
||||
} finally {
|
||||
await cleanupBaseDir(sandbox, baseDir)
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user