pub async fn update(args: ArgsOs) -> Result<()>Expand description
Pulls the main branch of the repo from which it’s called, then deletes any
local branches that are not ahead of trunk, and finally checks back out the
original branch. The trunk branch is the first existing branch returned by
trunk::names().
§Errors
Returns an error if no trunk can be identified, or any git command fails.
§TODO
- Delete remote branches behind trunk.
- Don’t mess up “checkout -” by checking out main. I tried not checking out main, but after fetch –prune, the user still sees a list of obsolete branches the next time they pull –prune; so now this program checks out main just so it can run pull –prune per se.