Reject --exclude-ref-prefix values that drop branches or tags

main

Commit

nodo3mo ago

The convert-sha256 docs promise that every branch and tag is always converted, since dropping any of them risks stranding cross-branch SHA1 references in commit and tag messages — the exact invariant the message-rewrite pass exists to maintain. The previous code piped req.ExcludeRefPrefixes straight into planner.BuildDesiredRefs, which applies it to branch and tag selection too, so the flag silently broke the promise.

Validate at the top of Run: refuse any prefix that, under the planner's HasPrefix matching, would catch a refs/heads/* or refs/tags/* name. The check covers bare "", "refs/", partial "refs/h", whole "refs/heads/" / "refs/tags/", and any sub- namespace under either. Help text on convert-sha256 now also calls the rejection out.

Entire-Checkpoint: ec9a87c6c8f1

Checkpoints

let's address some review comment for this change

Claude CodeOpus 4.7[1m]
View session
Checkpoint 1