Stop sending a guessed main as a trail's base

main

Commit

peyton-alt1w ago

With no --base, trail create took origin/HEAD and, when the clone had none, guessed main whenever origin/main existed. It sent that guess, so the server never applied the repo's real default branch. In a repo whose default is develop or release, the trail got base main: Entire's draft targeted main, and the user's own PR into the real default could not settle the trail, which stayed open with the draft re-running CI. When the user was on the default branch, the wrong guess also made the trail reuse that branch itself, so the draft proposed merging the whole default branch into main.

The base is now --base, else origin/HEAD, else origin's HEAD read with git ls-remote --symref (bounded, non-interactive, validated), else nothing: the server then uses the repo's default branch. Branch naming keeps the local main/master guess when the base is unknown; that guess is never sent.

Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com Entire-Checkpoint: 01M5R0EEXWT24BA9R6Z8PAWA45