mirror of
https://github.com/desktop/desktop
synced 2024-11-05 20:49:32 +00:00
Respect default branch setting when creating a new repository
This commit is contained in:
parent
82d25b5035
commit
750c424684
1 changed files with 6 additions and 1 deletions
|
@ -1,6 +1,11 @@
|
|||
import { getDefaultBranch } from '../helpers/default-branch'
|
||||
import { git } from './core'
|
||||
|
||||
/** Init a new git repository in the given path. */
|
||||
export async function initGitRepository(path: string): Promise<void> {
|
||||
await git(['init'], path, 'initGitRepository')
|
||||
await git(
|
||||
['-c', `init.defaultBranch=${await getDefaultBranch()}`, 'init'],
|
||||
path,
|
||||
'initGitRepository'
|
||||
)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue