Skip to content

resolveDefaultBranch

resolveDefaultBranch(dir, opts): Promise<string | null>

Defined in: src/pull.ts:38

Resolve the default branch name for dir, in order:

  1. hint — only if origin/<hint> actually exists (never trust the client blindly).
  2. local origin/HEAD (origin/mainmain).
  3. await opts.forgeDefault?.().
  4. none → null. A failing git step just falls through to the next source.

string

() => Promise<string | null>

string

Promise<string | null>