unison-cli-0.0.0
Safe HaskellSafe-Inferred
LanguageHaskell2010

Unison.Codebase.Editor.HandleInput.Branch

Description

branch input handler

Synopsis

Documentation

handleBranch :: BranchSourceI -> ProjectAndBranch (Maybe ProjectName) ProjectBranchName -> Cli () Source #

Create a new project branch from an existing project branch or namespace.

createBranch :: Text -> CreateFrom -> Project -> Transaction ProjectBranchName -> Cli (ProjectBranchId, ProjectBranchName) Source #

createBranch description createFrom project getNewBranchName:

  1. Creates a new branch row in project at the name from getNewBranchName (failing if branch already exists in project).
  2. Switches to the new branch.

This bit of functionality is factored out from the main handleBranch handler because it is also called by the release.draft command, which essentially just creates a branch, but with some different output for the user.

Returns the branch id and name of the newly-created branch.