Skip to content

Commit ce0eb9a

Browse files
committed
Set initial-branch (actions#427)
Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>
1 parent c8133b7 commit ce0eb9a

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

dist/index.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,11 @@ class GitCommandManager {
713713
}
714714
init() {
715715
return __awaiter(this, void 0, void 0, function* () {
716-
yield this.execGit(['init', this.workingDirectory]);
716+
yield this.execGit([
717+
'init',
718+
'--initial-branch=silence_warning_about_default_branch',
719+
this.workingDirectory
720+
]);
717721
});
718722
}
719723
isDetached() {

src/git-command-manager.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -328,7 +328,11 @@ class GitCommandManager {
328328
}
329329

330330
async init(): Promise<void> {
331-
await this.execGit(['init', this.workingDirectory])
331+
await this.execGit([
332+
'init',
333+
'--initial-branch=silence_warning_about_default_branch',
334+
this.workingDirectory
335+
])
332336
}
333337

334338
async isDetached(): Promise<boolean> {

0 commit comments

Comments
 (0)